mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Merge pull request #110601 from claudiubelu/path-filepath-update
Replaces path.Operation with filepath.Operation
This commit is contained in:
@@ -19,7 +19,6 @@ package removeall
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -117,11 +116,11 @@ func TestRemoveAllOneFilesystem(t *testing.T) {
|
||||
for _, item := range test.items {
|
||||
if strings.HasSuffix(item, "/") {
|
||||
item = strings.TrimRight(item, "/")
|
||||
if err = os.Mkdir(path.Join(tmpDir, item), 0777); err != nil {
|
||||
if err = os.Mkdir(filepath.Join(tmpDir, item), 0777); err != nil {
|
||||
t.Fatalf("error creating %s: %v", item, err)
|
||||
}
|
||||
} else {
|
||||
f, err := os.Create(path.Join(tmpDir, item))
|
||||
f, err := os.Create(filepath.Join(tmpDir, item))
|
||||
if err != nil {
|
||||
t.Fatalf("error creating %s: %v", item, err)
|
||||
}
|
||||
@@ -237,11 +236,11 @@ func TestRemoveDirsOneFilesystem(t *testing.T) {
|
||||
for _, item := range test.items {
|
||||
if strings.HasSuffix(item, "/") {
|
||||
item = strings.TrimRight(item, "/")
|
||||
if err = os.Mkdir(path.Join(tmpDir, item), 0777); err != nil {
|
||||
if err = os.Mkdir(filepath.Join(tmpDir, item), 0777); err != nil {
|
||||
t.Fatalf("error creating %s: %v", item, err)
|
||||
}
|
||||
} else {
|
||||
f, err := os.Create(path.Join(tmpDir, item))
|
||||
f, err := os.Create(filepath.Join(tmpDir, item))
|
||||
if err != nil {
|
||||
t.Fatalf("error creating %s: %v", item, err)
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ import (
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
@@ -72,7 +71,7 @@ func getDeviceNameFromMount(mounter mount.Interface, mountPath, pluginMountDir s
|
||||
}
|
||||
}
|
||||
|
||||
return path.Base(mountPath), nil
|
||||
return filepath.Base(mountPath), nil
|
||||
}
|
||||
|
||||
// DeviceOpened determines if the device is in use elsewhere
|
||||
|
Reference in New Issue
Block a user