mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 07:13:53 +00:00
Fix gce_pd to only use safe_format_and_mount when mounting block devices.
This commit is contained in:
parent
35fa143b29
commit
3d6c9fc9e8
@ -72,7 +72,7 @@ func (plugin *gcePersistentDiskPlugin) CanSupport(spec *api.Volume) bool {
|
|||||||
|
|
||||||
func (plugin *gcePersistentDiskPlugin) NewBuilder(spec *api.Volume, podUID types.UID) (volume.Builder, error) {
|
func (plugin *gcePersistentDiskPlugin) NewBuilder(spec *api.Volume, podUID types.UID) (volume.Builder, error) {
|
||||||
// Inject real implementations here, test through the internal function.
|
// Inject real implementations here, test through the internal function.
|
||||||
return plugin.newBuilderInternal(spec, podUID, &GCEDiskUtil{}, &gceSafeFormatAndMount{mount.New(), exec.New()})
|
return plugin.newBuilderInternal(spec, podUID, &GCEDiskUtil{}, mount.New())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *gcePersistentDiskPlugin) newBuilderInternal(spec *api.Volume, podUID types.UID, manager pdManager, mounter mount.Interface) (volume.Builder, error) {
|
func (plugin *gcePersistentDiskPlugin) newBuilderInternal(spec *api.Volume, podUID types.UID, manager pdManager, mounter mount.Interface) (volume.Builder, error) {
|
||||||
@ -98,6 +98,7 @@ func (plugin *gcePersistentDiskPlugin) newBuilderInternal(spec *api.Volume, podU
|
|||||||
readOnly: readOnly,
|
readOnly: readOnly,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
mounter: mounter,
|
mounter: mounter,
|
||||||
|
diskMounter: &gceSafeFormatAndMount{mounter, exec.New()},
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
legacyMode: false,
|
legacyMode: false,
|
||||||
}, nil
|
}, nil
|
||||||
@ -118,6 +119,7 @@ func (plugin *gcePersistentDiskPlugin) newCleanerInternal(volName string, podUID
|
|||||||
volName: volName,
|
volName: volName,
|
||||||
manager: manager,
|
manager: manager,
|
||||||
mounter: mounter,
|
mounter: mounter,
|
||||||
|
diskMounter: &gceSafeFormatAndMount{mounter, exec.New()},
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
legacyMode: legacy,
|
legacyMode: legacy,
|
||||||
}, nil
|
}, nil
|
||||||
@ -146,8 +148,10 @@ type gcePersistentDisk struct {
|
|||||||
readOnly bool
|
readOnly bool
|
||||||
// Utility interface that provides API calls to the provider to attach/detach disks.
|
// Utility interface that provides API calls to the provider to attach/detach disks.
|
||||||
manager pdManager
|
manager pdManager
|
||||||
// Mounter interface that provides system calls to mount the disks.
|
// Mounter interface that provides system calls to mount the global path to the pod local path.
|
||||||
mounter mount.Interface
|
mounter mount.Interface
|
||||||
|
// diskMounter provides the interface that is used to mount the actual block device.
|
||||||
|
diskMounter mount.Interface
|
||||||
plugin *gcePersistentDiskPlugin
|
plugin *gcePersistentDiskPlugin
|
||||||
legacyMode bool
|
legacyMode bool
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user