@@ -51,34 +51,31 @@ var _ volume.BlockVolumeMapper = &csiBlockMapper{}
51
51
var _ volume.CustomBlockVolumeMapper = & csiBlockMapper {}
52
52
53
53
// GetGlobalMapPath returns a global map path (on the node) to a device file which will be symlinked to
54
- // Example: plugins/kubernetes.io/csi/volumeDevices/{pvname }/dev
54
+ // Example: plugins/kubernetes.io/csi/volumeDevices/{specName }/dev
55
55
func (m * csiBlockMapper ) GetGlobalMapPath (spec * volume.Spec ) (string , error ) {
56
- dir := getVolumeDevicePluginDir (spec . Name () , m .plugin .host )
56
+ dir := getVolumeDevicePluginDir (m . specName , m .plugin .host )
57
57
klog .V (4 ).Infof (log ("blockMapper.GetGlobalMapPath = %s" , dir ))
58
58
return dir , nil
59
59
}
60
60
61
61
// getStagingPath returns a staging path for a directory (on the node) that should be used on NodeStageVolume/NodeUnstageVolume
62
- // Example: plugins/kubernetes.io/csi/volumeDevices/staging/{pvname }
62
+ // Example: plugins/kubernetes.io/csi/volumeDevices/staging/{specName }
63
63
func (m * csiBlockMapper ) getStagingPath () string {
64
- sanitizedSpecVolID := utilstrings .EscapeQualifiedName (m .specName )
65
- return filepath .Join (m .plugin .host .GetVolumeDevicePluginDir (CSIPluginName ), "staging" , sanitizedSpecVolID )
64
+ return filepath .Join (m .plugin .host .GetVolumeDevicePluginDir (CSIPluginName ), "staging" , m .specName )
66
65
}
67
66
68
67
// getPublishPath returns a publish path for a file (on the node) that should be used on NodePublishVolume/NodeUnpublishVolume
69
- // Example: plugins/kubernetes.io/csi/volumeDevices/publish/{pvname }
68
+ // Example: plugins/kubernetes.io/csi/volumeDevices/publish/{specName}/{podUID }
70
69
func (m * csiBlockMapper ) getPublishPath () string {
71
- sanitizedSpecVolID := utilstrings .EscapeQualifiedName (m .specName )
72
- return filepath .Join (m .plugin .host .GetVolumeDevicePluginDir (CSIPluginName ), "publish" , sanitizedSpecVolID )
70
+ return filepath .Join (m .plugin .host .GetVolumeDevicePluginDir (CSIPluginName ), "publish" , m .specName , string (m .podUID ))
73
71
}
74
72
75
73
// GetPodDeviceMapPath returns pod's device file which will be mapped to a volume
76
- // returns: pods/{podUid}/volumeDevices/kubernetes.io~csi, {pvname }
74
+ // returns: pods/{podUid}/volumeDevices/kubernetes.io~csi, {specName }
77
75
func (m * csiBlockMapper ) GetPodDeviceMapPath () (string , string ) {
78
76
path := m .plugin .host .GetPodVolumeDeviceDir (m .podUID , utilstrings .EscapeQualifiedName (CSIPluginName ))
79
- specName := m .specName
80
- klog .V (4 ).Infof (log ("blockMapper.GetPodDeviceMapPath [path=%s; name=%s]" , path , specName ))
81
- return path , specName
77
+ klog .V (4 ).Infof (log ("blockMapper.GetPodDeviceMapPath [path=%s; name=%s]" , path , m .specName ))
78
+ return path , m .specName
82
79
}
83
80
84
81
// stageVolumeForBlock stages a block volume to stagingPath
0 commit comments