package nsenter
import "k8s.io/kubernetes/pkg/volume/util/nsenter"
Index ¶
- func NewHostUtil(ne *nsenter.Nsenter, rootDir string) mount.HostUtils
- type Mounter
- func NewMounter(rootDir string, ne *nsenter.Nsenter) *Mounter
- func (n *Mounter) GetMountRefs(pathname string) ([]string, error)
- func (n *Mounter) IsLikelyNotMountPoint(file string) (bool, error)
- func (*Mounter) IsMountPointMatch(mp mount.MountPoint, dir string) bool
- func (*Mounter) List() ([]mount.MountPoint, error)
- func (n *Mounter) Mount(source string, target string, fstype string, options []string) error
- func (n *Mounter) Unmount(target string) error
Functions ¶
func NewHostUtil ¶
NewHostUtil returns a new mount.HostUtils implementation that works for kubelet running in a container
Types ¶
type Mounter ¶
type Mounter struct {
// contains filtered or unexported fields
}
Mounter implements mount.Interface Currently, all docker containers receive their own mount namespaces. Mounter works by executing nsenter to run commands in the host's mount namespace.
func NewMounter ¶
NewMounter creates a new mounter for kubelet that runs as a container.
func (*Mounter) GetMountRefs ¶
GetMountRefs finds all mount references to the path, returns a list of paths. Path could be a mountpoint path, device or a normal directory (for bind mount).
func (*Mounter) IsLikelyNotMountPoint ¶
IsLikelyNotMountPoint determines whether a path is a mountpoint by calling findmnt in the host's root mount namespace.
func (*Mounter) IsMountPointMatch ¶
func (*Mounter) IsMountPointMatch(mp mount.MountPoint, dir string) bool
IsMountPointMatch tests if dir and mp are the same path
func (*Mounter) List ¶
func (*Mounter) List() ([]mount.MountPoint, error)
List returns a list of all mounted filesystems in the host's mount namespace.
func (*Mounter) Mount ¶
Mount runs mount(8) in the host's root mount namespace. Aside from this aspect, Mount has the same semantics as the mounter returned by mount.New()
func (*Mounter) Unmount ¶
Unmount runs umount(8) in the host's mount namespace.
Source Files ¶
nsenter_mount.go
- Version
- v1.16.0-beta.1
- Published
- Aug 20, 2019
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 13 seconds ago –
Tools for package owners.