From 66590d6f83ee1d3488228de021e18617366406ed Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Fri, 3 Nov 2017 22:19:58 -0400 Subject: [PATCH] Container manager has a bad fake interface --- .../cm/container_manager_unsupported_test.go | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pkg/kubelet/cm/container_manager_unsupported_test.go b/pkg/kubelet/cm/container_manager_unsupported_test.go index ed8a4fb8701..592164b93f2 100644 --- a/pkg/kubelet/cm/container_manager_unsupported_test.go +++ b/pkg/kubelet/cm/container_manager_unsupported_test.go @@ -40,17 +40,20 @@ func (mi *fakeMountInterface) List() ([]mount.MountPoint, error) { return mi.mountPoints, nil } -func (f *fakeMountInterface) IsMountPointMatch(mp mount.MountPoint, dir string) bool { +func (mi *fakeMountInterface) IsMountPointMatch(mp mount.MountPoint, dir string) bool { return (mp.Path == dir) } -func (f *fakeMountInterface) IsNotMountPoint(dir string) (bool, error) { +func (mi *fakeMountInterface) IsNotMountPoint(dir string) (bool, error) { return false, fmt.Errorf("unsupported") } func (mi *fakeMountInterface) IsLikelyNotMountPoint(file string) (bool, error) { return false, fmt.Errorf("unsupported") } +func (mi *fakeMountInterface) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) { + return "", nil +} func (mi *fakeMountInterface) DeviceOpened(pathname string) (bool, error) { for _, mp := range mi.mountPoints { @@ -65,14 +68,26 @@ func (mi *fakeMountInterface) PathIsDevice(pathname string) (bool, error) { return true, nil } -func (mi *fakeMountInterface) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) { - return "", nil -} - func (mi *fakeMountInterface) MakeRShared(path string) error { return nil } +func (mi *fakeMountInterface) GetFileType(pathname string) (mount.FileType, error) { + return mount.FileType("fake"), nil +} + +func (mi *fakeMountInterface) MakeDir(pathname string) error { + return nil +} + +func (mi *fakeMountInterface) MakeFile(pathname string) error { + return nil +} + +func (mi *fakeMountInterface) ExistsPath(pathname string) bool { + return true +} + func fakeContainerMgrMountInt() mount.Interface { return &fakeMountInterface{ []mount.MountPoint{