Versions in this module Expand all Collapse all v1 v1.1.0 Mar 14, 2022 v1.0.0 Jun 3, 2021 v0 v0.9.0 Jun 23, 2020 Changes in this version + const FakeActionMount + const FakeActionUnmount + func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, error) + func HasMountRefs(mountPath string, mountRefs []string) bool + func IsNotMountPoint(mounter Interface, file string) (bool, error) + func PathWithinBase(fullPath, basePath string) bool + func ValidateDiskNumber(disk string) error — windows/amd64 + type Exec interface + Run func(cmd string, args ...string) ([]byte, error) + func NewOsExec() Exec + type FakeAction struct + Action string + FSType string + Source string + Target string + type FakeExec struct + func NewFakeExec(run runHook) *FakeExec + func (f *FakeExec) Run(cmd string, args ...string) ([]byte, error) + type FakeMounter struct + Filesystem map[string]FileType + Log []FakeAction + MountPoints []MountPoint + func (f *FakeMounter) CleanSubPaths(podDir string, volumeName string) error + func (f *FakeMounter) DeviceOpened(pathname string) (bool, error) + func (f *FakeMounter) EvalHostSymlinks(pathname string) (string, error) + func (f *FakeMounter) ExistsPath(pathname string) (bool, error) + func (f *FakeMounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) + func (f *FakeMounter) GetFSGroup(pathname string) (int64, error) + func (f *FakeMounter) GetFileType(pathname string) (FileType, error) + func (f *FakeMounter) GetMode(pathname string) (os.FileMode, error) + func (f *FakeMounter) GetMountRefs(pathname string) ([]string, error) + func (f *FakeMounter) GetSELinuxSupport(pathname string) (bool, error) + func (f *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error) + func (f *FakeMounter) IsMountPointMatch(mp MountPoint, dir string) bool + func (f *FakeMounter) IsNotMountPoint(dir string) (bool, error) + func (f *FakeMounter) List() ([]MountPoint, error) + func (f *FakeMounter) MakeDir(pathname string) error + func (f *FakeMounter) MakeFile(pathname string) error + func (f *FakeMounter) MakeRShared(path string) error + func (f *FakeMounter) Mount(source string, target string, fstype string, options []string) error + func (f *FakeMounter) PathIsDevice(pathname string) (bool, error) + func (f *FakeMounter) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) + func (f *FakeMounter) ResetLog() + func (f *FakeMounter) Unmount(target string) error + func (mounter *FakeMounter) SafeMakeDir(pathname string, base string, perm os.FileMode) error + type FileType string + const FileTypeBlockDev + const FileTypeCharDev + const FileTypeDirectory + const FileTypeFile + const FileTypeSocket + const MountsInGlobalPDPath + type Interface interface + CleanSubPaths func(podDir string, volumeName string) error + DeviceOpened func(pathname string) (bool, error) + EvalHostSymlinks func(pathname string) (string, error) + ExistsPath func(pathname string) (bool, error) + GetDeviceNameFromMount func(mountPath, pluginDir string) (string, error) + GetFSGroup func(pathname string) (int64, error) + GetFileType func(pathname string) (FileType, error) + GetMode func(pathname string) (os.FileMode, error) + GetMountRefs func(pathname string) ([]string, error) + GetSELinuxSupport func(pathname string) (bool, error) + IsLikelyNotMountPoint func(file string) (bool, error) + IsMountPointMatch func(mp MountPoint, dir string) bool + IsNotMountPoint func(file string) (bool, error) + List func() ([]MountPoint, error) + MakeDir func(pathname string) error + MakeFile func(pathname string) error + MakeRShared func(path string) error + Mount func(source string, target string, fstype string, options []string) error + PathIsDevice func(pathname string) (bool, error) + PrepareSafeSubpath func(subPath Subpath) (newHostPath string, cleanupAction func(), err error) + SafeMakeDir func(subdir string, base string, perm os.FileMode) error + Unmount func(target string) error + func New(mounterPath string) Interface + func NewExecMounter(exec Exec, wrapped Interface) Interface + type MountPoint struct + Device string + Freq int + Opts []string + Pass int + Path string + Type string + type Mounter struct + func (*Mounter) List() ([]MountPoint, error) + func (mounter *Mounter) CleanSubPaths(podDir string, volumeName string) error + func (mounter *Mounter) DeviceOpened(pathname string) (bool, error) + func (mounter *Mounter) EvalHostSymlinks(pathname string) (string, error) + func (mounter *Mounter) ExistsPath(pathname string) (bool, error) + func (mounter *Mounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) + func (mounter *Mounter) GetFSGroup(pathname string) (int64, error) + func (mounter *Mounter) GetFileType(pathname string) (FileType, error) + func (mounter *Mounter) GetMode(pathname string) (os.FileMode, error) + func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) + func (mounter *Mounter) GetSELinuxSupport(pathname string) (bool, error) + func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) + func (mounter *Mounter) IsMountPointMatch(mp MountPoint, dir string) bool + func (mounter *Mounter) IsNotMountPoint(dir string) (bool, error) + func (mounter *Mounter) List() ([]MountPoint, error) + func (mounter *Mounter) MakeDir(pathname string) error + func (mounter *Mounter) MakeFile(pathname string) error + func (mounter *Mounter) MakeRShared(path string) error + func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error + func (mounter *Mounter) PathIsDevice(pathname string) (bool, error) + func (mounter *Mounter) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) + func (mounter *Mounter) SafeMakeDir(pathname string, base string, perm os.FileMode) error + func (mounter *Mounter) SafeMakeDir(subdir string, base string, perm os.FileMode) error + func (mounter *Mounter) Unmount(target string) error + type NsenterMounter struct + func NewNsenterMounter(rootDir string, ne *nsenter.Nsenter) *NsenterMounter + func (*NsenterMounter) CleanSubPaths(podDir string, volumeName string) error + func (*NsenterMounter) DeviceOpened(pathname string) (bool, error) + func (*NsenterMounter) EvalHostSymlinks(pathname string) (string, error) + func (*NsenterMounter) ExistsPath(pathname string) (bool, error) + func (*NsenterMounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) + func (*NsenterMounter) GetFSGroup(pathname string) (int64, error) + func (*NsenterMounter) GetFileType(_ string) (FileType, error) + func (*NsenterMounter) GetMode(pathname string) (os.FileMode, error) + func (*NsenterMounter) GetMountRefs(pathname string) ([]string, error) + func (*NsenterMounter) GetSELinuxSupport(pathname string) (bool, error) + func (*NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) + func (*NsenterMounter) IsMountPointMatch(mp MountPoint, dir string) bool + func (*NsenterMounter) List() ([]MountPoint, error) + func (*NsenterMounter) MakeDir(pathname string) error + func (*NsenterMounter) MakeFile(pathname string) error + func (*NsenterMounter) MakeRShared(path string) error + func (*NsenterMounter) Mount(source string, target string, fstype string, options []string) error + func (*NsenterMounter) PathIsDevice(pathname string) (bool, error) + func (*NsenterMounter) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) + func (*NsenterMounter) SafeMakeDir(pathname string, base string, perm os.FileMode) error + func (*NsenterMounter) Unmount(target string) error + func (m *NsenterMounter) IsNotMountPoint(dir string) (bool, error) + func (mounter *NsenterMounter) CleanSubPaths(podDir string, volumeName string) error + func (mounter *NsenterMounter) EvalHostSymlinks(pathname string) (string, error) + func (mounter *NsenterMounter) ExistsPath(pathname string) (bool, error) + func (mounter *NsenterMounter) GetFSGroup(pathname string) (int64, error) + func (mounter *NsenterMounter) GetFileType(pathname string) (FileType, error) + func (mounter *NsenterMounter) GetMode(pathname string) (os.FileMode, error) + func (mounter *NsenterMounter) GetMountRefs(pathname string) ([]string, error) + func (mounter *NsenterMounter) GetSELinuxSupport(pathname string) (bool, error) + func (mounter *NsenterMounter) MakeDir(pathname string) error + func (mounter *NsenterMounter) MakeFile(pathname string) error + func (mounter *NsenterMounter) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) + func (mounter *NsenterMounter) SafeMakeDir(subdir string, base string, perm os.FileMode) error + func (n *NsenterMounter) DeviceOpened(pathname string) (bool, error) + func (n *NsenterMounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) + func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) + func (n *NsenterMounter) MakeRShared(path string) error + func (n *NsenterMounter) Mount(source string, target string, fstype string, options []string) error + func (n *NsenterMounter) PathIsDevice(pathname string) (bool, error) + func (n *NsenterMounter) Unmount(target string) error + type SafeFormatAndMount struct + func (mounter *SafeFormatAndMount) FormatAndMount(source string, target string, fstype string, options []string) error + func (mounter *SafeFormatAndMount) GetDiskFormat(disk string) (string, error) + type Subpath struct + ContainerName string + Path string + PodDir string + VolumeMountIndex int + VolumeName string + VolumePath string