feat: add config_path for containerd (#340)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2024-03-19 10:33:38 +08:00 committed by GitHub
parent f4e6b68a29
commit 35bd976da5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,12 @@ pub fn default_dfinit_log_dir() -> PathBuf {
super::default_log_dir().join(NAME) super::default_log_dir().join(NAME)
} }
// default_container_runtime_containerd_config_path is the default containerd configuration path.
#[inline]
fn default_container_runtime_containerd_config_path() -> PathBuf {
PathBuf::from("/etc/containerd/config.toml")
}
// Host is the host configuration for registry. // Host is the host configuration for registry.
#[derive(Debug, Clone, Default, Validate, Deserialize)] #[derive(Debug, Clone, Default, Validate, Deserialize)]
#[serde(default, rename_all = "camelCase")] #[serde(default, rename_all = "camelCase")]
@ -66,6 +72,10 @@ pub struct Containerd {
// enable is a flag to enable containerd feature. // enable is a flag to enable containerd feature.
pub enable: bool, pub enable: bool,
// config_path is the path of containerd configuration file.
#[serde(default = "default_container_runtime_containerd_config_path")]
pub config_path: PathBuf,
// registries is the list of containerd registries. // registries is the list of containerd registries.
pub registries: Vec<Registry>, pub registries: Vec<Registry>,
} }