mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +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:
		@@ -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,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user