container

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BWRunner

type BWRunner struct {
	Runner
}

func (*BWRunner) NeedsImage

func (bw *BWRunner) NeedsImage() bool

NeedsImage determines whether an image is needed for the given runner method. For Bubblewrap, this is false.

func (*BWRunner) Run

func (bw *BWRunner) Run(cfg *Config, args ...string) error

Run runs a Bubblewrap task given a Config and command string.

func (*BWRunner) StartPod

func (bw *BWRunner) StartPod(cfg *Config) error

StartPod starts a pod if necessary. Not implemented for Bubblewrap runners.

func (*BWRunner) TerminatePod

func (bw *BWRunner) TerminatePod(cfg *Config) error

TerminatePod terminates a pod if necessary. Not implemented for Bubblewrap runners.

func (*BWRunner) TestUsability

func (bw *BWRunner) TestUsability() bool

TestUsability determines if the Bubblewrap runner can be used as a container runner.

type BindMount

type BindMount struct {
	Source      string
	Destination string
}

type Capabilities

type Capabilities struct {
	Networking bool
}

type Config

type Config struct {
	Mounts       []BindMount
	Capabilities Capabilities
	Logger       *log.Logger
	Environment  map[string]string
	ImgDigest    string
	PodID        string
}

type DKRunner

type DKRunner struct {
	Runner
}

func (*DKRunner) NeedsImage

func (dk *DKRunner) NeedsImage() bool

NeedsImage determines whether an image is needed for the given runner method. For Docker, this is true.

func (*DKRunner) Run

func (dk *DKRunner) Run(cfg *Config, args ...string) error

Run runs a Docker task given a Config and command string.

func (*DKRunner) StartPod

func (dk *DKRunner) StartPod(cfg *Config) error

StartPod starts a pod for supporting a Docker task, if necessary.

func (*DKRunner) TerminatePod

func (dk *DKRunner) TerminatePod(cfg *Config) error

TerminatePod terminates a pod for supporting a Docker task, if necessary.

func (*DKRunner) TestUsability

func (dk *DKRunner) TestUsability() bool

TestUsability determines if the Docker runner can be used as a container runner.

type Runner

type Runner interface {
	TestUsability() bool
	NeedsImage() bool
	StartPod(cfg *Config) error
	Run(cfg *Config, cmd ...string) error
	TerminatePod(cfg *Config) error
}

func BubblewrapRunner

func BubblewrapRunner() Runner

BubblewrapRunner returns a Bubblewrap Runner implementation.

func DockerRunner

func DockerRunner() Runner

DockerRunner returns a Docker Runner implementation.

func GetRunner

func GetRunner() (Runner, error)

GetRunner returns the preferred runner implementation for the given environment.

Jump to

Keyboard shortcuts

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