diff --git a/pkg/util/mount/fake.go b/pkg/util/mount/fake.go index 063973527f1..0400f3b1812 100644 --- a/pkg/util/mount/fake.go +++ b/pkg/util/mount/fake.go @@ -32,11 +32,11 @@ type FakeMounter struct { MountCheckErrors map[string]error // Some tests run things in parallel, make sure the mounter does not produce // any golang's DATA RACE warnings. - mutex sync.Mutex - UmountFunc UmountFunc + mutex sync.Mutex + UnmountFunc UnmountFunc } -type UmountFunc func(path string) error +type UnmountFunc func(path string) error var _ Interface = &FakeMounter{} @@ -120,8 +120,8 @@ func (f *FakeMounter) Unmount(target string) error { newMountpoints := []MountPoint{} for _, mp := range f.MountPoints { if mp.Path == absTarget { - if f.UmountFunc != nil { - err := f.UmountFunc(absTarget) + if f.UnmountFunc != nil { + err := f.UnmountFunc(absTarget) if err != nil { return err } diff --git a/pkg/volume/util/subpath/subpath_linux_test.go b/pkg/volume/util/subpath/subpath_linux_test.go index 8a730a090bf..ca0c0d3744d 100644 --- a/pkg/volume/util/subpath/subpath_linux_test.go +++ b/pkg/volume/util/subpath/subpath_linux_test.go @@ -409,7 +409,7 @@ func TestCleanSubPaths(t *testing.T) { // Function that validates directory structure after the test validate func(base string) error expectError bool - umount func(path string) error + unmount func(path string) error }{ { name: "not-exists", @@ -557,7 +557,7 @@ func TestCleanSubPaths(t *testing.T) { } return mounts, nil }, - umount: func(mountpath string) error { + unmount: func(mountpath string) error { err := filepath.Walk(mountpath, func(path string, info os.FileInfo, err error) error { if path == mountpath { // Skip top level directory @@ -593,7 +593,7 @@ func TestCleanSubPaths(t *testing.T) { t.Fatalf("failed to prepare test %q: %v", test.name, err.Error()) } - fm := &mount.FakeMounter{MountPoints: mounts, UmountFunc: test.umount} + fm := &mount.FakeMounter{MountPoints: mounts, UnmountFunc: test.unmount} err = doCleanSubPaths(fm, base, testVol) if err != nil && !test.expectError {