-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CONTAINERS_CONF envariable insufficient for testing #15413
Comments
Of all these, |
I am fine with that. |
podman --dump-containers-conf ? |
On reflection ISTM to make more sense to add a command, not option. Probably hidden by default. Or, hmmm, a suboption of |
|
Do you want to just show the config file(s) used or dump the contents. Dumping the contents is easier. |
If I understand your question correctly, dump contents please. The idea is to do: $ podman info --format='{{.ContainersConf}}' >/tmp/my-temp-containers.conf
$ env CONTAINERS_CONF=/tmp/my-temp-containers.conf podman run ..... ...such that the second command will be 100% a NOP, because the tmp-conf file will be 100% identical to the configuration podman is running. The key bit is that one can then:
...and change only one variable in the podman environment, while keeping everything else the same. This is imperative for things like changing events backend, because this: $ cat >/tmp/foo.conf
events-backend=file
$ env CONTAINERS_CONF=/tmp/foo.conf podman run ... ...is super-duper-dangerous, because it completely disregards |
A friendly reminder that this issue had no activity for 30 days. |
ping, we really, really, really need this (for CNI/netavark testing) |
@rhatdan @mheon are you cool with the proposed change to |
Actually... the more I think about this, the more I realize this won't work. Not without proper toml-editing tools (something like |
...not CONTAINERS_CONF. At least for most tests. Nearly every system test currently using CONTAINERS_CONF=tmpfile should be using CONTAINERS_CONF_OVERRIDE. Simple reason: runtime (crun/runc), database_backend (bolt/sqlite), logger, and other important settings from /etc/c.conf are not usually written into the tmpfile. Those tests, therefore, are not running podman as configured on the system. Much more discussion: containers#15413 This PR is a prerequisite for enabling sqlite system tests. For the sake of simplicity and sanity, I choose to submit the sqlite switch as a separate PR once this passes and merges. Signed-off-by: Ed Santiago <[email protected]>
|
It's not as clear as I'd like, but this is the containers.conf man page:
To be 100% explicit: "just this path" means "podman will only read this file, ignoring all other
containers.conf
files in/usr/share/containers
an/etc/containers
.This is causing headaches and gaps in our test coverage, specifically Ubuntu and RHEL8 which use cgroups v1:
There are a ton of system tests that write custom
containers.conf
files with stuff likeuserns="auto"
,dns-this-that
,infra_image
,events_logger
. All of those, on Ubuntu and RHEL8, are being run withcrun
instead of the expectedrunc
. (This probably doesn't matter with some options, but I bet it does withuserns
). It also means that podman is running with its full capability set.This is really hard to fix. The options I see are:
CONTAINERS_CONF
mean "in addition to" not "exclusively". Nonstarter: it breaks compatibility (not a big deal on a test-only setting) but also breaks tests that require an exactly-tunedcontainers.conf
./run
. Or add a newCONTAINERS_CONF_PATH
envariable that defines what that path should be. (IMHO: Ewwww)CONTAINERS_CONF_EXTRA
envariable whose meaning is, "first read all the defaults, then read this one"--dump-containers-conf
option to podman, such that tests can use that to>/tmp/mycontainers.conf
and edit thatpodman run
/etc/containers/containers.conf.d
or the rootless equivalent (Nope. One of my hard-fast- principles is never to vandalize a system. If test crashes, this would leave a user's system in a nonstandard, possibly unusable, state)Suggestions (and fixes) welcome.
The text was updated successfully, but these errors were encountered: