fix: deprioritize OCI detection

This commit is contained in:
frectonz 2024-10-03 19:34:44 +03:00
parent 2504cc4906
commit d6f6965e80
No known key found for this signature in database
GPG Key ID: 9CFA458945B7094F

View File

@ -21,19 +21,6 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
return Some("OpenVZ".into());
}
if context_path(context, "/run/host/container-manager").exists() {
// systemd-nspawn
if read_file("/run/host/container-manager")
.map(|c| c.contains("systemd-nspawn"))
.unwrap_or_default()
{
return Some("nspawn".into());
}
// OCI
return Some("OCI".into());
}
let container_env_path = context_path(context, "/run/.containerenv");
if container_env_path.exists() {
@ -77,6 +64,11 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
return Some("Docker".into());
}
if context_path(context, "/run/host/container-manager").exists() {
// OCI
return Some("OCI".into());
}
None
}