namespace

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unshare

func Unshare(namespace Namespace) error

Unshare detaches the provided namespace from its parent by using the syscall.Unshare function.

Types

type Namespace

type Namespace interface {

	// Priority returns the priority of the namespace, which is used for sorting
	// namespaces in the From function. Namespaces with higher priorities are
	// processed earlier.
	Priority() int

	// Type returns the OCI LinuxNamespaceType key for the namespace
	Type() specs.LinuxNamespaceType

	// CloneFlag returns the flag that should be used with the `clone` or `unshare`
	// syscall. This flag determines the specific namespace that will be created
	// or unshared during these syscalls.
	CloneFlag() uintptr

	// Finalize performs additional steps required to complete the containerization
	// process after the `clone` or `unshare` syscall has been executed.
	Finalize(spec specs.Spec) error

	// IsSupported checks whether the namespace is supported by the runtime.
	// It returns `false` if the namespace cannot be used.
	IsSupported() bool
}

Namespace defines an interface for Linux namespaces and their containerization.

func From

func From(runtime ipc.RuntimePipeWriter, spec specs.Spec) (namespaces []Namespace, err error)

From prepares a list of namespaces based on the provided spec. It takes a RuntimePipeWriter and a spec as inputs and returns a slice of Namespace and an error if any occurs. The namespaces are sorted based on their priority before being returned.

Jump to

Keyboard shortcuts

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