Documentation ¶
Index ¶
- Constants
- Variables
- func AttachSelfConsole(ctx context.Context, attacher Attachable) error
- func HasAnyBind(mountOptions []string) bool
- func HasBind(mountOptions []string) bool
- func HasRBind(mountOptions []string) bool
- func HasReadOnly(mountOptions []string) bool
- func ReplaceOption(options []string, oldOpt string, newOpt string) []string
- func SetupSelfConsole(ctx context.Context) (<-chan console.WinSize, func(), error)
- type Attachable
- type BindMount
- type CleanupStack
- type Container
- type ContainerDef
- type ContainerExistsError
- type ContainerProc
- type ContainerState
- func (d ContainerState) ContainerExists() bool
- func (d ContainerState) ContainerID() string
- func (d ContainerState) IODir() IODir
- func (d ContainerState) InnerDir() string
- func (d ContainerState) OverlayDir() OverlayDir
- func (d ContainerState) RuncStateDir() string
- func (d ContainerState) Start(def ContainerDef) (Container, error)
- func (d ContainerState) SubOverlayDir(ctrPath string) OverlayDir
- type ContainerStateRoot
- type DevptsMount
- type FuseOverlayfsBackend
- type GenericMountOptions
- type IODir
- type InvalidMergedMountErr
- type Layer
- type MountBackend
- type MountTree
- type MountTreeOpt
- type Mounts
- type MqueueMount
- type NoOverlayfsBackend
- type OCIMount
- type OverlayDir
- type ProcfsMount
- type TmpfsMount
- type WaitResult
Constants ¶
View Source
const (
RuncInitArg = "runcinit"
)
Variables ¶
View Source
var (
AllCaps = oci.LinuxCapabilities{
Bounding: capList,
Effective: capList,
Permitted: capList,
Inheritable: capList,
Ambient: capList,
}
)
Functions ¶
func AttachSelfConsole ¶
func AttachSelfConsole(ctx context.Context, attacher Attachable) error
func HasAnyBind ¶
func HasReadOnly ¶
Types ¶
type Attachable ¶
type BindMount ¶
type BindMount struct { Source string Dest string Recursive bool Readonly bool GenericMountOptions }
func (BindMount) AddToMountTree ¶
type CleanupStack ¶
type CleanupStack []func() error
func (CleanupStack) Cleanup ¶
func (cleanups CleanupStack) Cleanup() error
func (CleanupStack) Push ¶
func (cleanups CleanupStack) Push(f func() error) CleanupStack
type Container ¶
type Container interface { Attachable Wait(context.Context) WaitResult Destroy(time.Duration) error }
type ContainerDef ¶
type ContainerDef struct { ContainerProc MountBackend Hostname string Mounts Mounts UpperDir string WorkDir string Persist bool ReadOnlyRootfs bool }
type ContainerExistsError ¶
type ContainerExistsError struct {
ID string
}
func (ContainerExistsError) Error ¶
func (e ContainerExistsError) Error() string
type ContainerProc ¶
type ContainerState ¶
type ContainerState string
func (ContainerState) ContainerExists ¶
func (d ContainerState) ContainerExists() bool
TODO use some locking approach (maybe an O_EXCL file?) to make it possible to check this and then Start() "atomically"
func (ContainerState) ContainerID ¶
func (d ContainerState) ContainerID() string
func (ContainerState) IODir ¶
func (d ContainerState) IODir() IODir
func (ContainerState) InnerDir ¶
func (d ContainerState) InnerDir() string
func (ContainerState) OverlayDir ¶
func (d ContainerState) OverlayDir() OverlayDir
func (ContainerState) RuncStateDir ¶
func (d ContainerState) RuncStateDir() string
func (ContainerState) Start ¶
func (d ContainerState) Start(def ContainerDef) (Container, error)
func (ContainerState) SubOverlayDir ¶
func (d ContainerState) SubOverlayDir(ctrPath string) OverlayDir
type ContainerStateRoot ¶
type ContainerStateRoot string
func (ContainerStateRoot) ContainerState ¶
func (d ContainerStateRoot) ContainerState(containerID string) ContainerState
type DevptsMount ¶
func (DevptsMount) AddToMountTree ¶
func (m DevptsMount) AddToMountTree(t *MountTree) error
type FuseOverlayfsBackend ¶
type FuseOverlayfsBackend struct {
FuseOverlayfsBin string
}
func (FuseOverlayfsBackend) SetupTree ¶
func (b FuseOverlayfsBackend) SetupTree(mt *MountTree, cs ContainerState, upperdir, workdir string) (_ []oci.Mount, cleanup CleanupStack, rerr error)
type GenericMountOptions ¶
func ParseGenericMountOpts ¶
func ParseGenericMountOpts(options []string) GenericMountOptions
func (GenericMountOptions) Opts ¶
func (o GenericMountOptions) Opts() []string
type InvalidMergedMountErr ¶
type InvalidMergedMountErr struct{}
func (InvalidMergedMountErr) Error ¶
func (e InvalidMergedMountErr) Error() string
type Layer ¶
func (Layer) AddToMountTree ¶
type MountBackend ¶
type MountBackend interface { // TODO make MountTree fields accessible outside this pkg so external impls // of MountBackend can be written SetupTree(mt *MountTree, cs ContainerState, upperdir, workdir string) ([]oci.Mount, CleanupStack, error) }
type MountTreeOpt ¶
type Mounts ¶
type Mounts []MountTreeOpt
func DefaultMounts ¶
func DefaultMounts() Mounts
func (Mounts) OCIMounts ¶
func (mounts Mounts) OCIMounts(state ContainerState, upperdir, workdir string, backend MountBackend) ([]oci.Mount, CleanupStack, error)
func (Mounts) With ¶
func (mounts Mounts) With(more ...MountTreeOpt) Mounts
type MqueueMount ¶
type MqueueMount struct{}
func (MqueueMount) AddToMountTree ¶
func (m MqueueMount) AddToMountTree(t *MountTree) error
type NoOverlayfsBackend ¶
type NoOverlayfsBackend struct{}
NoOverlayfsBackend throws an error if an overlay is required to turn the mount tree into a list of OCI mounts.
func (NoOverlayfsBackend) SetupTree ¶
func (b NoOverlayfsBackend) SetupTree(mt *MountTree, cs ContainerState, upperdir, workdir string) (_ []oci.Mount, cleanup CleanupStack, rerr error)
type OCIMount ¶
func (OCIMount) AddToMountTree ¶
type OverlayDir ¶
type OverlayDir string
func (OverlayDir) MountDir ¶
func (d OverlayDir) MountDir() string
func (OverlayDir) PrivateDir ¶
func (d OverlayDir) PrivateDir() string
func (OverlayDir) UpperDir ¶
func (d OverlayDir) UpperDir() string
func (OverlayDir) WorkDir ¶
func (d OverlayDir) WorkDir() string
type ProcfsMount ¶
type ProcfsMount struct{}
func (ProcfsMount) AddToMountTree ¶
func (m ProcfsMount) AddToMountTree(t *MountTree) error
type TmpfsMount ¶
type TmpfsMount struct { Dest string ByteSize uint Mode os.FileMode GenericMountOptions }
func (TmpfsMount) AddToMountTree ¶
func (m TmpfsMount) AddToMountTree(t *MountTree) error
type WaitResult ¶
type WaitResult struct { State *os.ProcessState Err error }
Click to show internal directories.
Click to hide internal directories.