containerd

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandLineSource added in v1.17.0

func CommandLineSource(hostRoot string, executablePath string) toml.Loader

CommandLineSource returns the CLI-based containerd config loader

func New

func New(opts ...Option) (engine.Interface, error)

New creates a containerd config with the specified options

Types

type Config

type Config struct {
	*toml.Tree
	// contains filtered or unexported fields
}

Config represents the containerd config

func (*Config) AddRuntime

func (c *Config) AddRuntime(name string, path string, setAsDefault bool) error

AddRuntime adds a runtime to the containerd config

func (*Config) AddRuntimeWithOptions added in v1.18.0

func (c *Config) AddRuntimeWithOptions(name string, path string, setAsDefault bool, options interface{}) error

func (Config) DefaultRuntime

func (c Config) DefaultRuntime() string

DefaultRuntime returns the default runtime for the cri-o config

func (*Config) EnableCDI added in v1.17.5

func (c *Config) EnableCDI()

EnableCDI sets the enable_cdi field in the Containerd config to true.

func (*Config) GetDefaultRuntimeOptions added in v1.18.0

func (c *Config) GetDefaultRuntimeOptions() interface{}

func (*Config) GetRuntimeConfig added in v1.17.0

func (c *Config) GetRuntimeConfig(name string) (engine.RuntimeConfig, error)

func (*Config) RemoveRuntime

func (c *Config) RemoveRuntime(name string) error

RemoveRuntime removes a runtime from the docker config

func (*Config) UpdateDefaultRuntime added in v1.18.0

func (c *Config) UpdateDefaultRuntime(name string, action string) error

UpdateDefaultRuntime updates the default runtime setting in the config. When action is 'set' the provided runtime name is set as the default. When action is 'unset' we make sure the provided runtime name is not the default.

type ConfigV1

type ConfigV1 Config

ConfigV1 represents a version 1 containerd config

func (*ConfigV1) AddRuntime

func (c *ConfigV1) AddRuntime(name string, path string, setAsDefault bool) error

AddRuntime adds a runtime to the containerd config

func (*ConfigV1) AddRuntimeWithOptions added in v1.18.0

func (c *ConfigV1) AddRuntimeWithOptions(name string, path string, setAsDefault bool, options interface{}) error

func (ConfigV1) DefaultRuntime

func (c ConfigV1) DefaultRuntime() string

DefaultRuntime returns the default runtime for the cri-o config

func (*ConfigV1) EnableCDI added in v1.17.5

func (c *ConfigV1) EnableCDI()

func (*ConfigV1) GetDefaultRuntimeOptions added in v1.18.0

func (c *ConfigV1) GetDefaultRuntimeOptions() interface{}

func (*ConfigV1) GetRuntimeConfig added in v1.17.0

func (c *ConfigV1) GetRuntimeConfig(name string) (engine.RuntimeConfig, error)

func (*ConfigV1) RemoveRuntime

func (c *ConfigV1) RemoveRuntime(name string) error

RemoveRuntime removes a runtime from the docker config

func (ConfigV1) Save

func (c ConfigV1) Save(path string) (int64, error)

Save writes the config to a file

func (*ConfigV1) UpdateDefaultRuntime added in v1.18.0

func (c *ConfigV1) UpdateDefaultRuntime(name string, action string) error

type ConfigWithDropIn added in v1.18.0

type ConfigWithDropIn struct {
	engine.Interface
	// contains filtered or unexported fields
}

A ConfigWithDropIn represents a pair of containerd configs. The first is the top-level config and the second is an in-memory drop-in config that only contains modifications made to the config.

func NewConfigWithDropIn added in v1.18.0

func NewConfigWithDropIn(logger logger.Interface, topLevelConfigPath string, containerToHostPathMap map[string]string, tlConfig *Config, dropInConfig engine.Interface) *ConfigWithDropIn

func (*ConfigWithDropIn) RemoveRuntime added in v1.18.0

func (c *ConfigWithDropIn) RemoveRuntime(name string) error

RemoveRuntime removes the runtime from both configs.

func (*ConfigWithDropIn) Save added in v1.18.0

func (c *ConfigWithDropIn) Save(dropInPath string) (int64, error)

Save the drop-in config to the specified path. The top-level config is optionally updated to include the required imports to allow the drop-in-file to be created.

func (*ConfigWithDropIn) UpdateDefaultRuntime added in v1.18.0

func (c *ConfigWithDropIn) UpdateDefaultRuntime(name string, action string) error

UpdateDefaultRuntime updates the default runtime setting in the drop-in config. When action is 'set' the provided runtime name is set as the default. When action is 'unset' we make sure the provided runtime name is not the default.

type Option

type Option func(*builder)

Option defines a function that can be used to configure the config builder

func WithConfigSource added in v1.17.0

func WithConfigSource(configSource toml.Loader) Option

WithConfigSource sets the source for the config.

func WithConfigVersion added in v1.17.4

func WithConfigVersion(configVersion int) Option

WithConfigVersion sets the config version for the config builder

func WithContainerAnnotations

func WithContainerAnnotations(containerAnnotations ...string) Option

WithContainerAnnotations sets the container annotations for the config builder

func WithContainerPathAsHostPath added in v1.18.0

func WithContainerPathAsHostPath(containerPath string, hostPath string) Option

WithContainerPathAsHostPath maps a given container path to a host path.

func WithLogger

func WithLogger(logger logger.Interface) Option

WithLogger sets the logger for the config builder

func WithRuntimeType

func WithRuntimeType(runtimeType string) Option

WithRuntimeType sets the runtime type for the config builder

func WithTopLevelConfigPath added in v1.18.0

func WithTopLevelConfigPath(path string) Option

WithTopLevelConfigPath sets the path for the top-level containerd config.

func WithUseLegacyConfig

func WithUseLegacyConfig(useLegacyConfig bool) Option

WithUseLegacyConfig sets the useLegacyConfig flag for the config builder.

Jump to

Keyboard shortcuts

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