Documentation
¶
Overview ¶
Package containerd implements the containerd EngineClient.
Index ¶
- Constants
- type ContainerdWatcher
- func (cw *ContainerdWatcher) Close()
- func (cw *ContainerdWatcher) ID(ctx context.Context) string
- func (cw *ContainerdWatcher) Inspect(ctx context.Context, nameorid string) (*whalewatcher.Container, error)
- func (cw *ContainerdWatcher) LifecycleEvents(ctx context.Context) (<-chan engineclient.ContainerEvent, <-chan error)
- func (cw *ContainerdWatcher) List(ctx context.Context) ([]*whalewatcher.Container, error)
Constants ¶
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.
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.
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 ¶
func (cw *ContainerdWatcher) ID(ctx context.Context) string
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 ¶
func (cw *ContainerdWatcher) List(ctx context.Context) ([]*whalewatcher.Container, error)
List all the currently alive and kicking containers, but do not list any containers without any processes.