aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDoan Luu Duc Tai <doan@luuduct.ai>2026-10-30 16:29:50 -0500
committerDoan Luu Duc Tai <doan@luuduct.ai>2026-10-30 16:29:50 -0500
commit1206813d47e8602f08cbeaf27e73453e089e7c52 (patch)
tree6ff6454d4f8cc092958c82666f0296082f7af778 /src
parent0a0cdc0c44dd8b4fb44d8a859962c40c593e98eb (diff)
Select rootless networking for the installed Podman version
Diffstat (limited to 'src')
-rw-r--r--src/project.rs17
1 files changed, 13 insertions, 4 deletions
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::<u32>()?;
+ if major < 6 {
+ command.env(
+ "CONTAINERS_CONF_OVERRIDE",
+ self.root.join("infra/podman.conf"),
+ );
+ }
command
.arg("--root")
.arg(self.root.join("var/podman/storage"))