mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 10:48:15 +00:00
add a clean code for TestCanSupport
update other location forgot two files need to be updated
This commit is contained in:
@@ -249,7 +249,8 @@ func newTestHost(t *testing.T, clientset clientset.Interface) (string, volume.Vo
|
|||||||
|
|
||||||
func TestCanSupport(t *testing.T) {
|
func TestCanSupport(t *testing.T) {
|
||||||
pluginMgr := volume.VolumePluginMgr{}
|
pluginMgr := volume.VolumePluginMgr{}
|
||||||
_, host := newTestHost(t, nil)
|
tempDir, host := newTestHost(t, nil)
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
||||||
@@ -278,9 +279,10 @@ func TestPlugin(t *testing.T) {
|
|||||||
configMap = configMap(testNamespace, testName)
|
configMap = configMap(testNamespace, testName)
|
||||||
client = fake.NewSimpleClientset(&configMap)
|
client = fake.NewSimpleClientset(&configMap)
|
||||||
pluginMgr = volume.VolumePluginMgr{}
|
pluginMgr = volume.VolumePluginMgr{}
|
||||||
_, host = newTestHost(t, client)
|
tempDir, host = newTestHost(t, client)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
||||||
@@ -344,6 +346,7 @@ func TestPluginReboot(t *testing.T) {
|
|||||||
rootDir, host = newTestHost(t, client)
|
rootDir, host = newTestHost(t, client)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
defer os.RemoveAll(rootDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
plugin, err := pluginMgr.FindPluginByName(configMapPluginName)
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ func newTestHost(t *testing.T) (string, volume.VolumeHost) {
|
|||||||
|
|
||||||
func TestCanSupport(t *testing.T) {
|
func TestCanSupport(t *testing.T) {
|
||||||
plugMgr := volume.VolumePluginMgr{}
|
plugMgr := volume.VolumePluginMgr{}
|
||||||
_, host := newTestHost(t)
|
tempDir, host := newTestHost(t)
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
|
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")
|
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")
|
||||||
@@ -221,6 +222,7 @@ func doTestPlugin(scenario struct {
|
|||||||
|
|
||||||
plugMgr := volume.VolumePluginMgr{}
|
plugMgr := volume.VolumePluginMgr{}
|
||||||
rootDir, host := newTestHost(t)
|
rootDir, host := newTestHost(t)
|
||||||
|
defer os.RemoveAll(rootDir)
|
||||||
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
|
plugMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")
|
plug, err := plugMgr.FindPluginByName("kubernetes.io/git-repo")
|
||||||
|
|||||||
@@ -252,7 +252,8 @@ func newTestHost(t *testing.T, clientset clientset.Interface) (string, volume.Vo
|
|||||||
|
|
||||||
func TestCanSupport(t *testing.T) {
|
func TestCanSupport(t *testing.T) {
|
||||||
pluginMgr := volume.VolumePluginMgr{}
|
pluginMgr := volume.VolumePluginMgr{}
|
||||||
_, host := newTestHost(t, nil)
|
tempDir, host := newTestHost(t, nil)
|
||||||
|
defer os.RemoveAll(tempDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
||||||
@@ -283,7 +284,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
pluginMgr = volume.VolumePluginMgr{}
|
pluginMgr = volume.VolumePluginMgr{}
|
||||||
rootDir, host = newTestHost(t, client)
|
rootDir, host = newTestHost(t, client)
|
||||||
)
|
)
|
||||||
|
defer os.RemoveAll(rootDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
||||||
@@ -356,7 +357,7 @@ func TestPluginReboot(t *testing.T) {
|
|||||||
pluginMgr = volume.VolumePluginMgr{}
|
pluginMgr = volume.VolumePluginMgr{}
|
||||||
rootDir, host = newTestHost(t, client)
|
rootDir, host = newTestHost(t, client)
|
||||||
)
|
)
|
||||||
|
defer os.RemoveAll(rootDir)
|
||||||
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
pluginMgr.InitPlugins(ProbeVolumePlugins(), host)
|
||||||
|
|
||||||
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
plugin, err := pluginMgr.FindPluginByName(secretPluginName)
|
||||||
|
|||||||
Reference in New Issue
Block a user