Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of Kubernetes. This is done by refactoring mount.Interface to only contain methods that are not K8s specific. Methods that are not relevant to basic mount activities but still have OS-specific implementations are now found in a mount.HostUtils interface.
This commit is contained in:
@@ -162,6 +162,7 @@ func newTestKubeletWithImageList(
|
||||
kubelet.heartbeatClient = fakeKubeClient
|
||||
kubelet.os = &containertest.FakeOS{}
|
||||
kubelet.mounter = &mount.FakeMounter{}
|
||||
kubelet.hostutil = &mount.FakeHostUtil{}
|
||||
kubelet.subpather = &subpath.FakeSubpath{}
|
||||
|
||||
kubelet.hostname = testKubeletHostname
|
||||
@@ -312,7 +313,6 @@ func newTestKubeletWithImageList(
|
||||
NewInitializedVolumePluginMgr(kubelet, kubelet.secretManager, kubelet.configMapManager, token.NewManager(kubelet.kubeClient), allPlugins, prober)
|
||||
require.NoError(t, err, "Failed to initialize VolumePluginMgr")
|
||||
|
||||
kubelet.mounter = &mount.FakeMounter{}
|
||||
kubelet.volumeManager = kubeletvolume.NewVolumeManager(
|
||||
controllerAttachDetachEnabled,
|
||||
kubelet.nodeName,
|
||||
@@ -322,6 +322,7 @@ func newTestKubeletWithImageList(
|
||||
kubelet.volumePluginMgr,
|
||||
fakeRuntime,
|
||||
kubelet.mounter,
|
||||
kubelet.hostutil,
|
||||
kubelet.getPodsDir(),
|
||||
kubelet.recorder,
|
||||
false, /* experimentalCheckNodeCapabilitiesBeforeMount*/
|
||||
|
Reference in New Issue
Block a user