Fixed a possible nil pointer dereference caused by variable plug
This commit is contained in:

committed by
Mengjiao Liu

parent
5de1a754c8
commit
c24b87b133
@@ -40,7 +40,7 @@ func TestCanSupport(t *testing.T) {
|
||||
plugMgr.InitPlugins(ProbeVolumePlugins(), nil /* prober */, volumetest.NewFakeVolumeHost(t, tmpDir, nil, nil))
|
||||
plug, err := plugMgr.FindPluginByName("kubernetes.io/cephfs")
|
||||
if err != nil {
|
||||
t.Errorf("Can't find the plugin by name")
|
||||
t.Fatal("Can't find the plugin by name")
|
||||
}
|
||||
if plug.GetPluginName() != "kubernetes.io/cephfs" {
|
||||
t.Errorf("Wrong name: %s", plug.GetPluginName())
|
||||
@@ -240,7 +240,7 @@ func TestGetAccessModes(t *testing.T) {
|
||||
|
||||
plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/cephfs")
|
||||
if err != nil {
|
||||
t.Errorf("Can't find the plugin by name")
|
||||
t.Fatal("Can't find the plugin by name")
|
||||
}
|
||||
modes := plug.GetAccessModes()
|
||||
for _, v := range modes {
|
||||
|
Reference in New Issue
Block a user