Change:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: Calls to on unsupported platforms do not report any error and potentially misbehave. What you expected to happen: I would expect an error to be reported, that can be consumed by the caller. How to reproduce it (as minimally and precisely as possible): for and were failing on darwin, and no error was being reported. See: & Environment: OS (e.g. from /etc/os-release): I have been testing on osx/darwin, which is not a supported platform.
/sig storage
/assign

Discussion:
import ( "errors" "os" <ins> "github.com/golang/glog" </ins> ) type Mounter struct { mounterPath string } <ins> var unsupportedErr = errors.New("util/mount on this platform is not supported") </ins> // New returns a mount.Interface for the current system. // It provides options to override the default mounter behavior. // mounterPath allows using an alternative to `/bin/mount` for mounting.

} func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } func (mounter *Mounter) Unmount(target string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } // GetMountRefs finds all other references to the device referenced // by mountPath; returns a list of paths. func GetMountRefs(mounter Interface, mountPath string) ([]string, error) { <del> return []string{}, nil </del> <ins> return []string{}, unsupportedErr </ins> } func (mounter *Mounter) List() ([]MountPoint, error) { <del> return []MountPoint{}, nil </del> <ins> return []MountPoint{}, unsupportedErr </ins> } func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool {

} func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { <del> return true, nil </del> <ins> return true, unsupportedErr </ins> } func (mounter *Mounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) { <del> return "", nil </del> <ins> return "", unsupportedErr </ins> } func getDeviceNameFromMount(mounter Interface, mountPath, pluginDir string) (string, error) { <del> return "", nil </del> <ins> return "", unsupportedErr </ins> } func (mounter *Mounter) DeviceOpened(pathname string) (bool, error) { <del> return false, nil </del> <ins> return false, unsupportedErr </ins> } func (mounter *Mounter) PathIsDevice(pathname string) (bool, error) { <del> return true, nil </del> <ins> return true, unsupportedErr </ins> } func (mounter *Mounter) MakeRShared(path string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } func (mounter *SafeFormatAndMount) formatAndMount(source string, target string, fstype string, options []string) error {

} func (mounter *SafeFormatAndMount) diskLooksUnformatted(disk string) (bool, error) { <del> return true, nil </del> <ins> return true, unsupportedErr </ins> } func (mounter *Mounter) GetFileType(pathname string) (FileType, error) { <del> return FileType("fake"), errors.New("not implemented") </del> <ins> return FileType("fake"), unsupportedErr </ins> } func (mounter *Mounter) MakeDir(pathname string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } func (mounter *Mounter) MakeFile(pathname string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } func (mounter *Mounter) ExistsPath(pathname string) bool { <ins> glog.Errorf("%s", unsupportedErr) </ins> return true } func (mounter *Mounter) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) { <del> return subPath.Path, nil, nil </del> <ins> return subPath.Path, nil, unsupportedErr </ins> } func (mounter *Mounter) CleanSubPaths(podDir string, volumeName string) error { <del> return nil </del> <ins> return unsupportedErr </ins> } func (mounter *Mounter) SafeMakeDir(pathname string, base string, perm os.FileMode) error { <del> return nil </del> <ins> return unsupportedErr </ins> }

"/var/lib/kubelet/pods/some-pod/volumes/kubernetes.io~fc/fc-in-pod2", } for _, path := range mountPaths { <del> refs, _ := mount.GetMountRefs(fm, path) </del> <ins> refs, err := mount.GetMountRefs(fm, path) if err != nil { t.Errorf("couldn't get mountrefs. err: %v", err) } </ins> var globalPDPath string for _, ref := range refs { if strings.Contains(ref, "kubernetes.io/fc") {