Documentation ¶
Index ¶
- Variables
- func NamespacesExists(ctx context.Context, namespaces []LinuxNamespace, ...) error
- func RefreshNamespace(ctx context.Context, ns *LinuxNamespace)
- func RefreshNamespaces(ctx context.Context, namespaces []LinuxNamespace, ...)
- func RootCommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd
- type BackgroundState
- type Config
- type ContainerBundle
- type ContainerState
- type IoOpts
- type LinuxNamespace
- type LinuxProcessInfo
- type Runc
- type SpecEditor
- func WithAnnotations(annotations map[string]string) SpecEditor
- func WithCapabilities(caps ...string) SpecEditor
- func WithCgroupPath(cgroupPath, child string) SpecEditor
- func WithDisableOOMKiller() SpecEditor
- func WithHostname(hostname string) SpecEditor
- func WithMountIfNotPresent(mount specs.Mount) SpecEditor
- func WithNamespace(ns LinuxNamespace) SpecEditor
- func WithNamespaces(ns []LinuxNamespace) SpecEditor
- func WithProcessArgs(args ...string) SpecEditor
- func WithProcessCwd(cwd string) SpecEditor
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrContainerNotFound = errors.New("container not found")
)
Functions ¶
func NamespacesExists ¶
func NamespacesExists(ctx context.Context, namespaces []LinuxNamespace, nsType ...specs.LinuxNamespaceType) error
func RefreshNamespace ¶
func RefreshNamespace(ctx context.Context, ns *LinuxNamespace)
func RefreshNamespaces ¶
func RefreshNamespaces(ctx context.Context, namespaces []LinuxNamespace, nsType ...specs.LinuxNamespaceType)
Types ¶
type BackgroundState ¶
type BackgroundState struct {
// contains filtered or unexported fields
}
func RunBundleInBackground ¶
func RunBundleInBackground(ctx context.Context, runc Runc, bundle ContainerBundle) (*BackgroundState, error)
func RunCommandInBackground ¶ added in v1.2.7
func (*BackgroundState) Exited ¶
func (r *BackgroundState) Exited() (bool, error)
func (*BackgroundState) Wait ¶
func (r *BackgroundState) Wait()
type Config ¶
type Config struct { Root string `json:"root" split_words:"true" required:"false"` Debug bool `json:"debug" split_words:"true" required:"false"` SystemdCgroup bool `json:"systemdCgroup" split_words:"true" required:"false"` Rootless string `json:"rootless" split_words:"true" required:"false"` NsmountPath string `json:"nsmountPath" split_words:"true" default:"nsmount"` }
func ConfigFromEnvironment ¶
func ConfigFromEnvironment() Config
type ContainerBundle ¶
type ContainerState ¶
type LinuxNamespace ¶
func FilterNamespaces ¶
func FilterNamespaces(ns []LinuxNamespace, types ...specs.LinuxNamespaceType) []LinuxNamespace
func ListNamespaces ¶ added in v1.2.8
type LinuxProcessInfo ¶
type LinuxProcessInfo struct { Pid int Namespaces []LinuxNamespace CGroupPath string }
func ReadLinuxProcessInfo ¶
func ReadLinuxProcessInfo(ctx context.Context, pid int) (LinuxProcessInfo, error)
type Runc ¶
type Runc interface { State(ctx context.Context, id string) (*ContainerState, error) Create(ctx context.Context, image, id string) (ContainerBundle, error) Run(ctx context.Context, container ContainerBundle, ioOpts IoOpts) error RunCommand(ctx context.Context, container ContainerBundle) (*exec.Cmd, error) Delete(ctx context.Context, id string, force bool) error Kill(background context.Context, id string, signal syscall.Signal) error }
type SpecEditor ¶
type SpecEditor func(spec *specs.Spec)
func WithAnnotations ¶
func WithAnnotations(annotations map[string]string) SpecEditor
func WithCapabilities ¶
func WithCapabilities(caps ...string) SpecEditor
func WithCgroupPath ¶
func WithCgroupPath(cgroupPath, child string) SpecEditor
func WithDisableOOMKiller ¶ added in v1.2.5
func WithDisableOOMKiller() SpecEditor
func WithHostname ¶
func WithHostname(hostname string) SpecEditor
func WithMountIfNotPresent ¶
func WithMountIfNotPresent(mount specs.Mount) SpecEditor
func WithNamespace ¶
func WithNamespace(ns LinuxNamespace) SpecEditor
func WithNamespaces ¶
func WithNamespaces(ns []LinuxNamespace) SpecEditor
func WithProcessArgs ¶
func WithProcessArgs(args ...string) SpecEditor
func WithProcessCwd ¶
func WithProcessCwd(cwd string) SpecEditor
Click to show internal directories.
Click to hide internal directories.