• Kubernetes Submit Queue's avatar
    Merge pull request #52401 from andyzhangx/azuredisk-getdevfunc · f34a24e9
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. 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 warning messages due to GetMountRefs func not implemented in windows
    
    **What this PR does / why we need it**:
    This PR completes the windows implementation of GetMountRefs in mount.go. In linux, the GetMountRefs implementaion is: read `/proc/mounts` and find all mount points, while in Windows, there is no such `/proc/mounts` place which shows all mounting points. 
    There is another way in windows, **we could walk through(by `getAllParentLinks` func) the mount path(symbolic link) and get all symlinks until we got the final device, which is actually a drive**.
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54670
    This PR fixed the warnning issue mentioned in https://github.com/kubernetes/kubernetes/pull/51252
    
    **Special notes for your reviewer**:
    Some values in the code would be like follwoing:
    ```
    GetMountRefs: mountPath ("\\var\\lib\\kubelet\\pods/4c74b128-92ca-11e7-b86b-000d3a36d70c/volumes/kubernetes.io~azure-disk/pvc-1cc91c70-92ca-11e7-b86b-000d3a36d70c")
    getAllParentLinks: refs (["" "" "c:\\var\\lib\\kubelet\\plugins\\kubernetes.io\\azure-disk\\mounts\\b1246717734" "G:\\"])
    basemountPath c:\var\lib\kubelet\plugins\kubernetes.io\azure-disk\mounts
    got volumeID b1246717734
    ```
    
    **Release note**:
    
    ```
    fix warning messages due to GetMountRefs func not implemented in windows
    ```
    f34a24e9
Name
Last commit
Last update
..
BUILD Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
exec.go Loading commit data...
fake.go Loading commit data...
mount.go Loading commit data...
mount_linux.go Loading commit data...
mount_linux_test.go Loading commit data...
mount_unsupported.go Loading commit data...
mount_windows.go Loading commit data...
mount_windows_test.go Loading commit data...
nsenter_mount.go Loading commit data...
nsenter_mount_test.go Loading commit data...
nsenter_mount_unsupported.go Loading commit data...
safe_format_and_mount_test.go Loading commit data...