From c5fc44582fcda107977ded15ec9e4c5723d86430 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 23 Mar 2023 11:08:20 +0100 Subject: [PATCH] add CONTAINERS_CONF_OVERRIDE Add yet another environment variable for loading containers.conf. When CONTAINERS_CONF_OVERRIDE is set, the specified config file will be loaded last - even when CONTAINERS_CONF is set. This mechanism is needed to preserve system settings and other environment variables. Setting CONTAINERS_CONF will load only the specified config file and ignore all system and user paths. That makes testing hard as many Podman tests use CONTAINERS_CONF for testing. The intended use of CONTAINERS_CONF_OVERRIDE is to set it during tests and point it to a specific configuration of Podman (e.g., netavark with sqlite backend). Similar needs have popped up talking to users in the automotive and high-performance computing space. In a way, such a setting allows for specifying a specific "flavor" of Podman while preserving all existing settings on the system. Signed-off-by: Valentin Rothberg --- test/system/005-info.bats | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 42ea58a1d6..7c6bcf997e 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -182,4 +182,30 @@ host.slirp4netns.executable | $expr_path is "$output" "Error: unsupported database backend: \"bogus\"" } +@test "CONTAINERS_CONF_OVERRIDE" { + skip_if_remote "remote does not support CONTAINERS_CONF*" + + containersConf=$PODMAN_TMPDIR/containers.conf + cat >$containersConf <$overrideConf <