• Kubernetes Submit Queue's avatar
    Merge pull request #65310 from wenlxie/upstream.master.fixlocalvolumevmnotfound · 55c5aaac
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 65582, 65480, 65310, 65644, 65645). 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>.
    
    Fix local volume directory can't be deleted issue
    
    **What this PR does / why we need it**:
    Need to add volume mode field to constructed pv spec.
    
    **Special notes for your reviewer**:
    I  get an issue:
    1) kubelet has lots of logs with errors  related with volume mode
    ```
    Jun 21 10:31:18  kubelet[19333]: E0621 10:31:18.422321   19333 reconciler.go:179] operationExecutor.NewVolumeHandler for UnmountVolume failed for volume "lv-e57cf589-4658-4881-b125-7b9f35c2c8eb" (UniqueName: "kubernetes.io/local-volume/4103e613-656c-11e8-8c20-74dbd180ddb4-lv-e57cf589-4658-4881-b125-7b9f35c2c8eb") pod "4103e613-656c-11e8-8c20-74dbd180ddb4" (UID: "4103e613-656c-11e8-8c20-74dbd180ddb4") : cannot get volumeMode for volume: lv-e57cf589-4658-4881-b125-7b9f35c2c8eb
    Jun 21 10:31:18  kubelet[19333]: E0621 10:31:18.422351   19333 reconciler.go:179] operationExecutor.NewVolumeHandler for UnmountVolume failed for volume "lv-b1e788ac-78eb-4d26-819a-263cef5337ea" (UniqueName: "kubernetes.io/local-volume/4082c1da-656c-11e8-8c20-74dbd180ddb4-lv-b1e788ac-78eb-4d26-819a-263cef5337ea") pod "4082c1da-656c-11e8-8c20-74dbd180ddb4" (UID: "4082c1da-656c-11e8-8c20-74dbd180ddb4") : cannot get volumeMode for volume: lv-b1e788ac-78eb-4d26-819a-263cef5337ea
    ```
    2) The pod is an orphan pod and have the volume directory left at the node
    
    3) Because of the errors, the volume directory will never be deleted
    
    **Release note**:
    ```release-note
    Fix local volume directory can't be deleted because of volumeMode error
    ```
    55c5aaac
Name
Last commit
Last update
..
BUILD Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
local.go Loading commit data...
local_linux_test.go Loading commit data...
local_test.go Loading commit data...