Commit fdc67468 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #46382 from verult/FlexVolumeMinorPatches

Automatic merge from submit-queue (batch tested with PRs 38751, 44282, 46382, 47603, 47606) Adding 'flexvolume' prefix to FlexVolume plugin names. **What this PR does / why we need it**: Adds a prefix to FlexVolume plugin names in order to more easily identify plugins as FlexVolume. Improves debugging. **Special notes for your reviewer**: Unfortunately the delimiter after 'flexvolume' is restricted to either '-' or '.' . This makes the prefix seem like it's part of the vendor name. Not sure if this could cause issues later on. **Release note**: ```release-note NONE ```
parents 48d263d3 8b2e1b55
......@@ -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")
}
......
......@@ -63,7 +63,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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment