mountutil

package
v2.0.0-beta.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bind   = "bind"
	Volume = "volume"
	Tmpfs  = "tmpfs"
	Npipe  = "npipe"
)
View Source
const (
	DefaultMountType = "none"

	// DefaultPropagationMode is the default propagation of mounts
	// where user doesn't specify mount propagation explicitly.
	// See also: https://github.com/moby/moby/blob/v20.10.7/volume/mounts/linux_parser.go#L145
	DefaultPropagationMode = "rprivate"
)

Variables

This section is empty.

Functions

func UnprivilegedMountFlags

func UnprivilegedMountFlags(path string) ([]string, error)

UnprivilegedMountFlags is from https://github.com/moby/moby/blob/v20.10.5/daemon/oci_linux.go#L420-L450

Get the set of mount flags that are set on the mount that contains the given path and are locked by CL_UNPRIVILEGED. This is necessary to ensure that bind-mounting "with options" will not fail with user namespaces, due to kernel restrictions that require user namespace mounts to preserve CL_UNPRIVILEGED locked flags.

Types

type Processed

type Processed struct {
	Type            string
	Mount           specs.Mount
	Name            string // name
	AnonymousVolume string // anonymous volume name
	Mode            string
	Opts            []oci.SpecOpts
}

func ProcessFlagMount

func ProcessFlagMount(s string, volStore volumestore.VolumeStore) (*Processed, error)

func ProcessFlagTmpfs

func ProcessFlagTmpfs(s string) (*Processed, error)

func ProcessFlagV

func ProcessFlagV(s string, volStore volumestore.VolumeStore, createDir bool) (*Processed, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL