Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 715a167

Browse files
committed
Add pluginName to VolumeHost.GetMouter
Different plugins can get different mounter, depending where the mount utilities are.
1 parent f031be0 commit 715a167

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

pkg/volume/cinder/attacher.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (plugin *cinderPlugin) NewAttacher() (volume.Attacher, error) {
6666
}
6767

6868
func (plugin *cinderPlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error) {
69-
mounter := plugin.host.GetMounter()
69+
mounter := plugin.host.GetMounter(plugin.GetPluginName())
7070
return mount.GetMountRefs(mounter, deviceMountPath)
7171
}
7272

@@ -262,7 +262,7 @@ func (attacher *cinderDiskAttacher) GetDeviceMountPath(
262262

263263
// FIXME: this method can be further pruned.
264264
func (attacher *cinderDiskAttacher) MountDevice(spec *volume.Spec, devicePath string, deviceMountPath string) error {
265-
mounter := attacher.host.GetMounter()
265+
mounter := attacher.host.GetMounter(cinderVolumePluginName)
266266
notMnt, err := mounter.IsLikelyNotMountPoint(deviceMountPath)
267267
if err != nil {
268268
if os.IsNotExist(err) {
@@ -309,7 +309,7 @@ func (plugin *cinderPlugin) NewDetacher() (volume.Detacher, error) {
309309
return nil, err
310310
}
311311
return &cinderDiskDetacher{
312-
mounter: plugin.host.GetMounter(),
312+
mounter: plugin.host.GetMounter(plugin.GetPluginName()),
313313
cinderProvider: cinder,
314314
}, nil
315315
}

pkg/volume/cinder/cinder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (plugin *cinderPlugin) GetAccessModes() []v1.PersistentVolumeAccessMode {
116116
}
117117

118118
func (plugin *cinderPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ volume.VolumeOptions) (volume.Mounter, error) {
119-
return plugin.newMounterInternal(spec, pod.UID, &CinderDiskUtil{}, plugin.host.GetMounter())
119+
return plugin.newMounterInternal(spec, pod.UID, &CinderDiskUtil{}, plugin.host.GetMounter(plugin.GetPluginName()))
120120
}
121121

122122
func (plugin *cinderPlugin) newMounterInternal(spec *volume.Spec, podUID types.UID, manager cdManager, mounter mount.Interface) (volume.Mounter, error) {
@@ -143,7 +143,7 @@ func (plugin *cinderPlugin) newMounterInternal(spec *volume.Spec, podUID types.U
143143
}
144144

145145
func (plugin *cinderPlugin) NewUnmounter(volName string, podUID types.UID) (volume.Unmounter, error) {
146-
return plugin.newUnmounterInternal(volName, podUID, &CinderDiskUtil{}, plugin.host.GetMounter())
146+
return plugin.newUnmounterInternal(volName, podUID, &CinderDiskUtil{}, plugin.host.GetMounter(plugin.GetPluginName()))
147147
}
148148

149149
func (plugin *cinderPlugin) newUnmounterInternal(volName string, podUID types.UID, manager cdManager, mounter mount.Interface) (volume.Unmounter, error) {
@@ -216,7 +216,7 @@ func (plugin *cinderPlugin) getCloudProvider() (CinderProvider, error) {
216216
}
217217

218218
func (plugin *cinderPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) {
219-
mounter := plugin.host.GetMounter()
219+
mounter := plugin.host.GetMounter(plugin.GetPluginName())
220220
pluginDir := plugin.host.GetPluginDir(plugin.GetPluginName())
221221
sourceName, err := mounter.GetDeviceNameFromMount(mountPath, pluginDir)
222222
if err != nil {

0 commit comments

Comments
 (0)