Adding 'flexvolume' prefix to FlexVolume plugin names.

This commit is contained in:
Cheng Xing
2017-05-24 13:25:05 -07:00
parent b9e8d2aee6
commit 8b2e1b55e0
4 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"title": "Kubernetes",
"version": "v1.7.0"
"version": "v1.8.0"
},
"paths": {
"/api/": {

View File

@@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"title": "Generic API Server",
"version": "v1.7.0"
"version": "v1.8.0"
},
"paths": {
"/api/": {

View File

@@ -175,11 +175,11 @@ func TestCanSupport(t *testing.T) {
plugMgr := volume.VolumePluginMgr{}
installPluginUnderTest(t, "kubernetes.io", "fakeAttacher", tmpDir, execScriptTempl1, nil)
plugMgr.InitPlugins(ProbeVolumePlugins(tmpDir), volumetest.NewFakeVolumeHost("fake", nil, nil))
plugin, err := plugMgr.FindPluginByName("kubernetes.io/fakeAttacher")
plugin, err := plugMgr.FindPluginByName("flexvolume-kubernetes.io/fakeAttacher")
if err != nil {
t.Errorf("Can't find the plugin by name")
}
if plugin.GetPluginName() != "kubernetes.io/fakeAttacher" {
if plugin.GetPluginName() != "flexvolume-kubernetes.io/fakeAttacher" {
t.Errorf("Wrong name: %s", plugin.GetPluginName())
}
if !plugin.CanSupport(&volume.Spec{Volume: &v1.Volume{VolumeSource: v1.VolumeSource{FlexVolume: &v1.FlexVolumeSource{Driver: "kubernetes.io/fakeAttacher"}}}}) {
@@ -204,7 +204,7 @@ func TestGetAccessModes(t *testing.T) {
installPluginUnderTest(t, "kubernetes.io", "fakeAttacher", tmpDir, execScriptTempl1, nil)
plugMgr.InitPlugins(ProbeVolumePlugins(tmpDir), volumetest.NewFakeVolumeHost(tmpDir, nil, nil))
plugin, err := plugMgr.FindPersistentPluginByName("kubernetes.io/fakeAttacher")
plugin, err := plugMgr.FindPersistentPluginByName("flexvolume-kubernetes.io/fakeAttacher")
if err != nil {
t.Fatalf("Can't find the plugin by name")
}

View File

@@ -62,7 +62,7 @@ func (plugin *flexVolumePlugin) getExecutable() string {
// Name is part of the volume.VolumePlugin interface.
func (plugin *flexVolumePlugin) GetPluginName() string {
return plugin.driverName
return "flexvolume-" + plugin.driverName
}
// GetVolumeName is part of the volume.VolumePlugin interface.