From 1206813d47e8602f08cbeaf27e73453e089e7c52 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Fri, 30 Oct 2026 16:29:50 -0500 Subject: Select rootless networking for the installed Podman version --- src/project.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/project.rs b/src/project.rs index f643704..0dac2ef 100644 --- a/src/project.rs +++ b/src/project.rs @@ -170,10 +170,19 @@ impl Project { command.env("PATH", env::join_paths(paths)?); } if name == "podman" { - command.env( - "CONTAINERS_CONF_OVERRIDE", - self.root.join("infra/podman.conf"), - ); + let version = process::text(Command::new("podman").arg("--version"))?; + let major = version + .split_whitespace() + .nth(2) + .and_then(|value| value.split('.').next()) + .context("Cannot determine the Podman version")? + .parse::()?; + if major < 6 { + command.env( + "CONTAINERS_CONF_OVERRIDE", + self.root.join("infra/podman.conf"), + ); + } command .arg("--root") .arg(self.root.join("var/podman/storage")) -- cgit v1.2.3