Documentation ¶
Overview ¶
Package cri contains the container runtime interface abstraction. This exists to abstract Docker and Docker-in-Docker away from the main worker implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRI ¶
type CRI interface { ImagePull(ctx context.Context, log logr.Logger, image string) error ContainerCreate(ctx context.Context, spec *ContainerSpec) (Container, error) }
CRI is an implementation of a container runtime.
type Container ¶
type Container interface { ID() string Status(ctx context.Context) (*ContainerStatus, error) Run(ctx context.Context, stdout, stderr io.Writer) (int, error) Remove(ctx context.Context) error ReadFiles(ctx context.Context, path string) (io.ReadCloser, fs.FileInfo, error) }
Container represents a single container managed by a CRI.
type ContainerSpec ¶
type ContainerSpec struct { Name string Image string Entrypoint []string Command []string Env map[string]string WorkingDir string Volumes map[string]struct{} Binds []string Privileged bool PodWith Container }
ContainerSpec contains a container specification.
type ContainerStatus ¶
ContainerStatus contains information about the current state of a container.
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
Docker is a Docker CRI implementation.
func NewDocker ¶
func NewDocker(client client.APIClient, config *configfile.ConfigFile) *Docker
NewDocker wraps a Docker client and config file as a CRI.
func (*Docker) ContainerCreate ¶
ContainerCreate creates a new Docker container.
type SandboxFactory ¶
type SandboxFactory interface {
SandboxCreate(ctx context.Context, log logr.Logger, name string) (Sandbox, error)
}
SandboxFactory is a factory which can create Sandboxes.
func NewDockerInDockerSandbox ¶
func NewDockerInDockerSandbox(cri CRI, config *configfile.ConfigFile, image string) SandboxFactory
NewDockerInDockerSandbox creates a SandboxFactory which uses an existing CRI to run docker-in-docker.