Documentation ¶
Index ¶
- func CleanupContent(containerDir string) (Err error)
- func CleanupMount(contentDir string) (Err error)
- func GenerateStructure(containerDir, containerID, name string, rootUID, rootGID int) (string, error)
- func Mount(contentDir, source, dest string, rootUID, rootGID int, graphOptions []string) (mount specs.Mount, Err error)
- func MountReadOnly(contentDir, source, dest string, rootUID, rootGID int, graphOptions []string) (mount specs.Mount, Err error)
- func MountWithOptions(contentDir, source, dest string, opts *Options) (mount specs.Mount, Err error)
- func RemoveTemp(contentDir string) error
- func TempDir(containerDir string, rootUID, rootGID int) (string, error)
- func Unmount(contentDir string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupContent ¶ added in v1.8.4
CleanupContent removes all temporary mountpoint and all content from directory
func CleanupMount ¶ added in v1.13.0
CleanupMount removes all temporary mountpoint content
func GenerateStructure ¶ added in v1.22.2
func GenerateStructure(containerDir, containerID, name string, rootUID, rootGID int) (string, error)
GenerateStructure generates an overlay directory structure for container content
func Mount ¶ added in v1.13.0
func Mount(contentDir, source, dest string, rootUID, rootGID int, graphOptions []string) (mount specs.Mount, Err error)
Mount creates a subdir of the contentDir based on the source directory from the source system. It then mounts up the source directory on to the generated mount point and returns the mount point to the caller.
func MountReadOnly ¶ added in v1.17.0
func MountReadOnly(contentDir, source, dest string, rootUID, rootGID int, graphOptions []string) (mount specs.Mount, Err error)
MountReadOnly creates a subdir of the contentDir based on the source directory from the source system. It then mounts up the source directory on to the generated mount point and returns the mount point to the caller. Note that no upper layer will be created rendering it a read-only mount
func MountWithOptions ¶ added in v1.24.0
func MountWithOptions(contentDir, source, dest string, opts *Options) (mount specs.Mount, Err error)
MountWithOptions creates a subdir of the contentDir based on the source directory from the source system. It then mounts up the source directory on to the generated mount point and returns the mount point to the caller. But allows api to set custom workdir, upperdir and other overlay options Following API is being used by podman at the moment
func RemoveTemp ¶
RemoveTemp removes temporary mountpoint and all content from its parent directory
Types ¶
type Options ¶ added in v1.24.0
type Options struct { // The Upper directory is normally writable layer in an overlay mount. // Note!! : Following API does not handles escaping or validates correctness of the values // passed to UpperDirOptionFragment instead API will try to pass values as is it // to the `mount` command. It is user's responsibility to make sure they pre-validate // these values. Invalid inputs may lead to undefined behaviour. // This is provided as-is, use it if it works for you, we can/will change/break that in the future. // See discussion here for more context: https://github.com/containers/buildah/pull/3715#discussion_r786036959 // TODO: Should we address above comment and handle escaping of metacharacters like // `comma`, `backslash` ,`colon` and any other special characters UpperDirOptionFragment string // The Workdir is used to prepare files as they are switched between the layers. // Note!! : Following API does not handles escaping or validates correctness of the values // passed to WorkDirOptionFragment instead API will try to pass values as is it // to the `mount` command. It is user's responsibility to make sure they pre-validate // these values. Invalid inputs may lead to undefined behaviour. // This is provided as-is, use it if it works for you, we can/will change/break that in the future. // See discussion here for more context: https://github.com/containers/buildah/pull/3715#discussion_r786036959 // TODO: Should we address above comment and handle escaping of metacharacters like // `comma`, `backslash` ,`colon` and any other special characters WorkDirOptionFragment string // Graph options relayed from podman, will be responsible for choosing mount program GraphOpts []string // Mark if following overlay is read only ReadOnly bool // RootUID is not used yet but keeping it here for legacy reasons. RootUID int // RootGID is not used yet but keeping it here for legacy reasons. RootGID int }
Options type holds various configuration options for overlay MountWithOptions accepts following type so it is easier to specify more verbose configuration for overlay mount.