Documentation
¶
Index ¶
- Constants
- type Boot
- type BootConfig
- type Capability
- type Config
- type ContainerdComponent
- func (c *ContainerdComponent) Client() (*containerd.Client, error)
- func (c *ContainerdComponent) IsRunning() bool
- func (c *ContainerdComponent) PID() (int, error)
- func (c *ContainerdComponent) SocketPath() string
- func (c *ContainerdComponent) Start(ctx context.Context, config *Config) error
- func (c *ContainerdComponent) Stop(ctx context.Context) error
Constants ¶
const Namespace = "miren"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boot ¶ added in v0.15.0
type Boot struct {
Component *boot.Component
Output boot.Output[Capability]
// contains filtered or unexported fields
}
Boot owns a containerd client and, when configured, its embedded daemon.
func NewBoot ¶ added in v0.15.0
func NewBoot(name string, config BootConfig) *Boot
NewBoot declares a containerd boot component.
type BootConfig ¶ added in v0.15.0
type BootConfig struct {
Log *slog.Logger
DataPath string
SocketPath string
Embedded *Config
ReadinessTimeout time.Duration
StopTimeout time.Duration
// ReportVersion, when set, receives the version of each runtime piece
// once it is confirmed running: the containerd daemon, and for an
// embedded daemon the runc beside it. An upgrade that replaced them on
// disk reads this back to see that the swap took.
ReportVersion func(component, version string)
}
BootConfig describes either an external containerd socket or an embedded daemon. Embedded is nil when the daemon is managed outside this process.
func EmbeddedBootConfig ¶ added in v0.15.0
func EmbeddedBootConfig(log *slog.Logger, dataPath, binaryPath, binDir, socketPath string) BootConfig
EmbeddedBootConfig starts a daemon and connects to it. binaryPath may be an executable name when binDir is empty, in which case startup resolves PATH.
func ExternalBootConfig ¶ added in v0.15.0
func ExternalBootConfig(log *slog.Logger, dataPath, socketPath string) BootConfig
ExternalBootConfig connects to a daemon managed outside this process.
type Capability ¶ added in v0.15.0
type Capability struct {
Client *containerdclient.Client
Namespace string
}
Capability is the ready containerd service consumed by boot graph nodes. Embedded and external daemons publish the same value.
type Config ¶
type Config struct {
// Path to the containerd binary
BinaryPath string
// Base directory for containerd data and configuration
BaseDir string
// Directory containing shim binaries (e.g. containerd-shim-runc-v2)
BinDir string
// Optional: custom config file path. If empty, generates default config
ConfigPath string
// Optional: socket path. If empty, uses default in BaseDir
SocketPath string
// Optional: additional environment variables
Env []string
}
Config defines the configuration for running containerd
type ContainerdComponent ¶
type ContainerdComponent struct {
// contains filtered or unexported fields
}
ContainerdComponent manages a containerd instance
func NewContainerdComponent ¶
func NewContainerdComponent(log *slog.Logger, dataPath string) *ContainerdComponent
NewContainerdComponent creates a new containerd component
func (*ContainerdComponent) Client ¶
func (c *ContainerdComponent) Client() (*containerd.Client, error)
Client returns the containerd client
func (*ContainerdComponent) IsRunning ¶
func (c *ContainerdComponent) IsRunning() bool
IsRunning returns true if containerd is running
func (*ContainerdComponent) PID ¶
func (c *ContainerdComponent) PID() (int, error)
PID returns the PID of the running containerd process
func (*ContainerdComponent) SocketPath ¶
func (c *ContainerdComponent) SocketPath() string
SocketPath returns the path to the containerd socket