diff --git a/pkg/volume/csi/csi_plugin_test.go b/pkg/volume/csi/csi_plugin_test.go index 2007da92c3b..c9f4af9397d 100644 --- a/pkg/volume/csi/csi_plugin_test.go +++ b/pkg/volume/csi/csi_plugin_test.go @@ -20,7 +20,6 @@ import ( "fmt" "math/rand" "os" - "path" "path/filepath" "testing" @@ -376,7 +375,7 @@ func TestPluginConstructVolumeSpec(t *testing.T) { csiMounter := mounter.(*csiMountMgr) // rebuild spec - spec, err := plug.ConstructVolumeSpec("test-pv", path.Dir(csiMounter.GetPath())) + spec, err := plug.ConstructVolumeSpec("test-pv", filepath.Dir(csiMounter.GetPath())) if err != nil { t.Fatal(err) } @@ -508,7 +507,7 @@ func TestPluginConstructVolumeSpecWithInline(t *testing.T) { csiMounter := mounter.(*csiMountMgr) // rebuild spec - spec, err := plug.ConstructVolumeSpec("test-pv", path.Dir(csiMounter.GetPath())) + spec, err := plug.ConstructVolumeSpec("test-pv", filepath.Dir(csiMounter.GetPath())) if err != nil { t.Fatal(err) } @@ -636,7 +635,7 @@ func TestPluginNewMounter(t *testing.T) { } // ensure data file is created - dataDir := path.Dir(mounter.GetPath()) + dataDir := filepath.Dir(mounter.GetPath()) dataFile := filepath.Join(dataDir, volDataFileName) if _, err := os.Stat(dataFile); err != nil { if os.IsNotExist(err) { @@ -775,7 +774,7 @@ func TestPluginNewMounterWithInline(t *testing.T) { } // ensure data file is created - dataDir := path.Dir(mounter.GetPath()) + dataDir := filepath.Dir(mounter.GetPath()) dataFile := filepath.Join(dataDir, volDataFileName) if _, err := os.Stat(dataFile); err != nil { if os.IsNotExist(err) { @@ -834,7 +833,7 @@ func TestPluginNewUnmounter(t *testing.T) { } if err := saveVolumeData( - path.Dir(dir), + filepath.Dir(dir), volDataFileName, map[string]string{ volDataKey.specVolID: pv.ObjectMeta.Name, diff --git a/pkg/volume/csi/csi_test.go b/pkg/volume/csi/csi_test.go index 3ec20217760..aeeda488a8a 100644 --- a/pkg/volume/csi/csi_test.go +++ b/pkg/volume/csi/csi_test.go @@ -20,7 +20,6 @@ import ( "fmt" "math/rand" "os" - "path" "path/filepath" "testing" "time" @@ -422,14 +421,14 @@ func TestCSI_VolumeAll(t *testing.T) { } t.Log("csiTest.VolumeAll mounter.Setup(fsGroup) done OK") - dataFile := filepath.Join(path.Dir(mounter.GetPath()), volDataFileName) + dataFile := filepath.Join(filepath.Dir(mounter.GetPath()), volDataFileName) if _, err := os.Stat(dataFile); err != nil { t.Fatalf("csiTest.VolumeAll meatadata JSON file not found: %s", dataFile) } t.Log("csiTest.VolumeAll JSON datafile generated OK:", dataFile) // ******** Volume Reconstruction ************* // - volPath := path.Dir(csiMounter.GetPath()) + volPath := filepath.Dir(csiMounter.GetPath()) t.Log("csiTest.VolumeAll entering plugin.ConstructVolumeSpec for path", volPath) spec, err := volPlug.ConstructVolumeSpec(test.volName, volPath) if err != nil {