Add Exec interface to VolumeHost
This exec should be used by volume plugins to execute mount utilities. It will eventually execute things in mount containers.
This commit is contained in:
@@ -49,6 +49,7 @@ type fakeVolumeHost struct {
|
||||
pluginMgr VolumePluginMgr
|
||||
cloud cloudprovider.Interface
|
||||
mounter mount.Interface
|
||||
exec mount.Exec
|
||||
writer io.Writer
|
||||
}
|
||||
|
||||
@@ -64,6 +65,7 @@ func newFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins [
|
||||
host := &fakeVolumeHost{rootDir: rootDir, kubeClient: kubeClient, cloud: cloud}
|
||||
host.mounter = &mount.FakeMounter{}
|
||||
host.writer = &io.StdWriter{}
|
||||
host.exec = mount.NewFakeExec(nil)
|
||||
host.pluginMgr.InitPlugins(plugins, host)
|
||||
return host
|
||||
}
|
||||
@@ -142,6 +144,10 @@ func (f *fakeVolumeHost) GetSecretFunc() func(namespace, name string) (*v1.Secre
|
||||
}
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetExec(pluginName string) mount.Exec {
|
||||
return f.exec
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetConfigMapFunc() func(namespace, name string) (*v1.ConfigMap, error) {
|
||||
return func(namespace, name string) (*v1.ConfigMap, error) {
|
||||
return f.kubeClient.Core().ConfigMaps(namespace).Get(name, metav1.GetOptions{})
|
||||
|
||||
Reference in New Issue
Block a user