mirror of
https://github.com/siderolabs/talos.git
synced 2025-09-11 17:01:20 +02:00
Containerd doesn't support merging plugin configuration from multiple sources, and Talos has several pieces which configure CRI plugin: (see https://github.com/containerd/containerd/issues/5837) * base config * registry mirror config * system extensions * ... So we implement our own simple way of merging config parts (by simply concatenating text files) to build a final `cri.toml`. At the same time containerd migrated to a new format to specify registry mirror configuration, while old way (via CRI config) is going to be removed in 1.7.0. New way also allows to apply most of registry configuration (except for auth) on the fly. Also, containerd was updated to 1.6.0-rc.0 and runc to 1.1.0. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package containerd
|
|
|
|
// AuthConfig represents the registry auth options.
|
|
type AuthConfig struct {
|
|
Username string `toml:"username"`
|
|
Password string `toml:"password"`
|
|
Auth string `toml:"auth"`
|
|
IdentityToken string `toml:"identitytoken"`
|
|
}
|
|
|
|
// RegistryConfig represents a registry.
|
|
type RegistryConfig struct {
|
|
Auth *AuthConfig `toml:"auth"`
|
|
}
|
|
|
|
// Registry represents the registry configuration.
|
|
type Registry struct {
|
|
ConfigPath string `toml:"config_path"`
|
|
Configs map[string]RegistryConfig `toml:"configs"`
|
|
}
|
|
|
|
// CRIConfig represents the CRI config.
|
|
type CRIConfig struct {
|
|
Registry Registry `toml:"registry"`
|
|
}
|
|
|
|
// PluginsConfig represents the CRI plugins config.
|
|
type PluginsConfig struct {
|
|
CRI CRIConfig `toml:"io.containerd.grpc.v1.cri"`
|
|
}
|
|
|
|
// Config represnts the containerd config.
|
|
type Config struct {
|
|
Plugins PluginsConfig `toml:"plugins"`
|
|
}
|