Refactor pkg/util/mount to be more reusable
This patch refactors pkg/util/mount to be more usable outside of Kubernetes. This is done by refactoring mount.Interface to only contain methods that are not K8s specific. Methods that are not relevant to basic mount activities but still have OS-specific implementations are now found in a mount.HostUtils interface.
This commit is contained in:
@@ -661,7 +661,7 @@ func createSocketFile(socketDir string) (string, error) {
|
||||
}
|
||||
|
||||
func TestGetFileType(t *testing.T) {
|
||||
mounter := Mounter{"fake/path", false}
|
||||
hu := NewHostUtil()
|
||||
|
||||
testCase := []struct {
|
||||
name string
|
||||
@@ -750,7 +750,7 @@ func TestGetFileType(t *testing.T) {
|
||||
defer os.RemoveAll(cleanUpPath)
|
||||
}
|
||||
|
||||
fileType, err := mounter.GetFileType(path)
|
||||
fileType, err := hu.GetFileType(path)
|
||||
if err != nil {
|
||||
t.Fatalf("[%d-%s] unexpected error : %v", idx, tc.name, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user