mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #37413 from vmware/FixUnmountVolume
Automatic merge from submit-queue kubernetes attempts to unmount a wrong vSphere volume and stops making any progress after that This is in reference to the bug #37332 which was accidentally closed. So created this new PR. The code is already reviewed as part of PR #37332 Fixes issue #37022 @saad-ali @jingxu97 @abrarshivani @kerneltime
This commit is contained in:
commit
5658addb9b
@ -119,11 +119,18 @@ func (plugin *vsphereVolumePlugin) newUnmounterInternal(volName string, podUID t
|
||||
}
|
||||
|
||||
func (plugin *vsphereVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) {
|
||||
mounter := plugin.host.GetMounter()
|
||||
pluginDir := plugin.host.GetPluginDir(plugin.GetPluginName())
|
||||
volumePath, err := mounter.GetDeviceNameFromMount(mountPath, pluginDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
glog.V(5).Infof("vSphere volume path is %q", volumePath)
|
||||
vsphereVolume := &v1.Volume{
|
||||
Name: volumeName,
|
||||
VolumeSource: v1.VolumeSource{
|
||||
VsphereVolume: &v1.VsphereVirtualDiskVolumeSource{
|
||||
VolumePath: volumeName,
|
||||
VolumePath: volumePath,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user