• Kubernetes Submit Queue's avatar
    Merge pull request #59169 from NickrenREN/kubectl-pv-terminating · f65f0722
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 55439, 58564, 59028, 59169, 59259). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    kubectl: Add Terminating state to PVs
    
    kubectl shows PV `Terminating` status, just like Pod and [PVC](https://github.com/kubernetes/kubernetes/pull/55873)
    
    **What this PR does / why we need it**:
    We will postpone PV deletion if it is bound to a PVC, see #58743, so we may keep PV waiting for deletion for a longer time than before so users should know what is going on.
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    xref: https://github.com/kubernetes/community/pull/1608
    
    **Special notes for your reviewer**:
    
    **Release note**:
    ```release-note
    NONE
    ```
    /sig cli
    /sig storage
    /assign @jsafrane 
    
    I tested this PR on my local host.
    ```
    nickren@nickren-14:~/test/test$ kubectl delete -f pv.yaml 
    persistentvolume "task-pv-volume" deleted
    nickren@nickren-14:~/test/test$ kubectl get pv
    NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                   STORAGECLASS   REASON    AGE
    task-pv-volume   1Gi        RWO            Delete           Terminating   default/task-pv-claim   standard                 27s
    nickren@nickren-14:~/test/test$ kubectl describe pv task-pv-volume
    Name:            task-pv-volume
    Labels:          type=local
    Annotations:     pv.kubernetes.io/bound-by-controller=yes
    Finalizers:      [kubernetes.io/pv-protection]
    StorageClass:    standard
    Status:          Terminating (since Thu, 01 Feb 2018 13:18:51 +0800)
    Claim:           default/task-pv-claim
    Reclaim Policy:  Delete
    Access Modes:    RWO
    Capacity:        1Gi
    Message:         
    Source:
        Type:          HostPath (bare host directory volume)
        Path:          /tmp/data
        HostPathType:  
    Events:            <none>
    ```
    f65f0722
Name
Last commit
Last update
..
api Loading commit data...
apis Loading commit data...
auth Loading commit data...
capabilities Loading commit data...
client Loading commit data...
cloudprovider Loading commit data...
controller Loading commit data...
credentialprovider Loading commit data...
features Loading commit data...
fieldpath Loading commit data...
generated Loading commit data...
kubeapiserver Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
master Loading commit data...
printers Loading commit data...
probe Loading commit data...
proxy Loading commit data...
quota Loading commit data...
registry Loading commit data...
routes Loading commit data...
scheduler Loading commit data...
security Loading commit data...
securitycontext Loading commit data...
serviceaccount Loading commit data...
ssh Loading commit data...
util Loading commit data...
version Loading commit data...
volume Loading commit data...
watch Loading commit data...
.import-restrictions Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...