Fix dfinit issue when containerd config_path have multiple paths (#895)

* Fix dfinit issue when containerd config_path have multiple paths

* Update containerd.rs - lint fix
This commit is contained in:
aliazlan-t 2024-12-16 19:04:10 -08:00 committed by GitHub
parent ea2d3fbd5d
commit d6b613e333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -66,6 +66,9 @@ impl Containerd {
.and_then(|config_path| config_path.as_str()) .and_then(|config_path| config_path.as_str())
.filter(|config_path| !config_path.is_empty()) .filter(|config_path| !config_path.is_empty())
{ {
// Rebind config_path to the first entry if multiple paths are present
let config_path = config_path.split(':').next().unwrap_or(config_path);
info!( info!(
"containerd supports config_path mode, config_path: {}", "containerd supports config_path mode, config_path: {}",
config_path.to_string() config_path.to_string()