containerd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package containerd implements the containerd EngineClient.

Index

Constants

View Source
const DockerNamespace = "moby"

DockerNamespace is the name of the containerd namespace used by Docker for its own containers (and tasks). As the whalewatcher module has a dedicated Docker engine client, we need to skip this namespace -- the rationale is that especially the container name is missing at the containerd engine level, but only available via the docker/moby API.

View Source
const NerdctlLabelPrefix = "nerdctl/"

NerdctlLabelPrefix is the label key prefix used to namespace (oh no, not another "namespace") nertctl-related labels. On purpose, we don't import nerdctl's definitions in order to avoid even more dependencies.

View Source
const NerdctlNameLabel = NerdctlLabelPrefix + "namespace"

NerdctlNameLabel stores a container's name, as opposed to the ID.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerdWatcher

type ContainerdWatcher struct {
	// contains filtered or unexported fields
}

ContainerdWatcher is a containerd EngineClient for interfacing the generic whale watching with containerd daemons.

func NewContainerdWatcher

func NewContainerdWatcher(client *containerd.Client) *ContainerdWatcher

NewContainerdWatcher returns a new ontainerdWatcher using the specified containerd engine client; normally, you would want to use this lower-level constructor only in unit tests.

func (*ContainerdWatcher) Close

func (cw *ContainerdWatcher) Close()

Close cleans up and release any engine client resources, if necessary.

func (*ContainerdWatcher) ID

ID returns the (more or less) unique engine identifier; the exact format is engine-specific.

func (*ContainerdWatcher) Inspect

func (cw *ContainerdWatcher) Inspect(ctx context.Context, nameorid string) (*whalewatcher.Container, error)

Inspect (only) those container details of interest to us, given the name or ID of a container.

func (*ContainerdWatcher) LifecycleEvents

func (cw *ContainerdWatcher) LifecycleEvents(ctx context.Context) (<-chan engineclient.ContainerEvent, <-chan error)

LifecycleEvents streams container engine events, limited just to those events in the lifecycle of containers getting born (=alive, as opposed to, say, "conceived") and die.

func (*ContainerdWatcher) List

List all the currently alive and kicking containers, but do not list any containers without any processes.

Jump to

Keyboard shortcuts

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