Documentation
¶
Index ¶
- func CommandLineSource(hostRoot string, executablePath string) toml.Loader
- func New(opts ...Option) (engine.Interface, error)
- type Config
- type ConfigV1
- func (c *ConfigV1) AddRuntime(name string, path string, setAsDefault bool) error
- func (c ConfigV1) DefaultRuntime() string
- func (c *ConfigV1) EnableCDI()
- func (c *ConfigV1) GetRuntimeConfig(name string) (engine.RuntimeConfig, error)
- func (c *ConfigV1) RemoveRuntime(name string) error
- func (c ConfigV1) Save(path string) (int64, error)
- type Option
- func WithConfigSource(configSource toml.Loader) Option
- func WithConfigVersion(configVersion int) Option
- func WithContainerAnnotations(containerAnnotations ...string) Option
- func WithLogger(logger logger.Interface) Option
- func WithPath(path string) Option
- func WithRuntimeType(runtimeType string) Option
- func WithUseLegacyConfig(useLegacyConfig bool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandLineSource ¶ added in v1.17.0
CommandLineSource returns the CLI-based containerd config loader
Types ¶
type Config ¶
type Config struct { *toml.Tree Version int64 Logger logger.Interface RuntimeType string ContainerAnnotations []string // UseLegacyConfig indicates whether a config file pre v1.3 should be generated. // For version 1 config prior to containerd v1.4 the default runtime was // specified in a containerd.runtimes.default_runtime section. // This was deprecated in v1.4 in favour of containerd.default_runtime_name. // Support for this section has been removed in v2.0. UseLegacyConfig bool // CRIRuntimePluginName represents the fully qualified name of the containerd plugin // for the CRI runtime service. The name of this plugin was changed in v3 of the // containerd configuration file. CRIRuntimePluginName string }
Config represents the containerd config
func (*Config) AddRuntime ¶
AddRuntime adds a runtime to the containerd config
func (Config) DefaultRuntime ¶
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) GetRuntimeConfig ¶ added in v1.17.0
func (c *Config) GetRuntimeConfig(name string) (engine.RuntimeConfig, error)
func (*Config) RemoveRuntime ¶
RemoveRuntime removes a runtime from the docker config
type ConfigV1 ¶
type ConfigV1 Config
ConfigV1 represents a version 1 containerd config
func (*ConfigV1) AddRuntime ¶
AddRuntime adds a runtime to the containerd config
func (ConfigV1) DefaultRuntime ¶
DefaultRuntime returns the default runtime for the cri-o config
func (*ConfigV1) GetRuntimeConfig ¶ added in v1.17.0
func (c *ConfigV1) GetRuntimeConfig(name string) (engine.RuntimeConfig, error)
func (*ConfigV1) RemoveRuntime ¶
RemoveRuntime removes a runtime from the docker config
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
WithConfigSource sets the source for the config.
func WithConfigVersion ¶ added in v1.17.4
WithConfigVersion sets the config version for the config builder
func WithContainerAnnotations ¶
WithContainerAnnotations sets the container annotations for the config builder
func WithLogger ¶
WithLogger sets the logger for the config builder
func WithRuntimeType ¶
WithRuntimeType sets the runtime type for the config builder
func WithUseLegacyConfig ¶
WithUseLegacyConfig sets the useLegacyConfig flag for the config builder.