mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 22:33:34 +00:00
Merge pull request #4221 from brendandburns/pd_fix
Make gce_safe_format_and_mount actually work correctly.
This commit is contained in:
commit
b77abb5945
@ -25,6 +25,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/volume"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/volume"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/exec"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/mount"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/mount"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
@ -97,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
|
||||||
@ -117,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
|
||||||
@ -145,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
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ func (util *GCEDiskUtil) DetachDisk(pd *gcePersistentDisk, devicePath string) er
|
|||||||
// This eliminates the necesisty to format a PD before it is used with a Pod on GCE.
|
// This eliminates the necesisty to format a PD before it is used with a Pod on GCE.
|
||||||
// TODO: port this script into Go and use it for all Linux platforms
|
// TODO: port this script into Go and use it for all Linux platforms
|
||||||
type gceSafeFormatAndMount struct {
|
type gceSafeFormatAndMount struct {
|
||||||
mount.Mounter
|
mount.Interface
|
||||||
runner exec.Interface
|
runner exec.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user