Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCrictl ¶
ExecCrictl runs the crictl CLI in-process against ephemerd's embedded containerd. The CRI plugin is registered by the containerd builtins blank import (see server.go) and served on the same socket as the native API.
This function sets CONTAINER_RUNTIME_ENDPOINT / IMAGE_SERVICE_ENDPOINT to the CRI URI for socketPath, then invokes crictl's urfave/cli v2 app via the k3s-io/cri-tools fork's exported Main() entry point (upstream cri-tools is package main; the fork patches it to package crictl so we can call it as a library). The replace directive is in go.mod.
crictl.Main() may call logrus.Fatal (which os.Exit's) on unrecoverable errors. That's acceptable because the caller is a leaf "ephemerd crictl" subcommand whose process is meant to exit anyway.
func ExecCtr ¶
ExecCtr runs the ctr CLI against ephemerd's containerd instance. This provides the "ephemerd ctrctl" debugging interface.
func SocketPath ¶
SocketPath returns the containerd socket path for the given data directory.
Types ¶
type Config ¶
type Config struct {
DataDir string
// SocketPath optionally overrides the gRPC listener path. Empty falls
// back to the platform default (\\.\pipe\ephemerd-containerd on Windows,
// <DataDir>/containerd/containerd.sock on Unix). Used by tests so
// multiple containerd instances can co-exist with the running daemon.
SocketPath string
TCPPort uint32 // optional: also listen on TCP for remote access (e.g. from WSL host)
TCPAddr string // optional bind address for TCP listener (default "127.0.0.1")
Log *slog.Logger
}
Config for the embedded containerd instance.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages the in-process containerd lifecycle.
func New ¶
New creates and starts an embedded containerd server in-process.
containerd runs as a Go library in a goroutine, following the k3s/rke2 model. No external containerd binary is needed.