-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman kube generate - add actual tests #15365
podman kube generate - add actual tests #15365
Conversation
LGTM. The fact that we'll have to update this every time we change |
I was thinking of that as a feature...? |
LGTM |
What - I have to get tests to pass, too?? OK srsly this has taken me into all sorts of ratholes. Filed #15367 and am finding more instances of it to report. Then, sigh, looks like the container order in But this one has me stumped: the |
@umohnani8 PTAL |
643055f
to
5cfaf92
Compare
Okay, can someone tell me why ubuntu local (root, rootless) has no
That is: on all f36, I get the (It's very very easy for me to just remove that test completely, but I hate doing so without an explanation) |
Any chance there's a |
Ohhh.... interesting. I think that's it: podman/test/system/helpers.bash Lines 39 to 51 in 5de215e
|
Interesting. If I recreate the capabilities section of containers.conf, ubuntu can't ping:
root nor rootless ... but it works perfectly fine with remote?? |
1f06c3c
to
6749958
Compare
This exposed a nasty bug in our system-test setup: Ubuntu (runc) was writing a scratch containers.conf file, and setting CONTAINERS_CONF to point to it. This was well-intentionedly introduced in containers#10199 as part of our long sad history of not testing runc. What I did not understand at that time is that CONTAINERS_CONF is **dangerous**: it does not mean "I will read standard containers.conf and then override", it means "I will **IGNORE** standard containers.conf and use only the settings in this file"! So on Ubuntu we were losing all the default settings: capabilities, sysctls, all. Yes, this is documented in containers.conf(5) but it is such a huge violation of POLA that I need to repeat it. In containers#14972, as yet another attempt to fix our runc crisis, I introduced a new runc-override mechanism: create a custom /etc/containers/containers.conf when OCI_RUNTIME=runc. Unlike the CONTAINERS_CONF envariable, the /etc file actually means what you think it means: "read the default file first, then override with the /etc file contents". I.e., we get the desired defaults. But I didn't remember this helpers.bash workaround, so our runc testing has actually been flawed: we have not been testing with the system containers.conf. This commit removes the no-longer-needed and never-actually-wanted workaround, and by virtue of testing the cap-drops in kube generate, we add a regression test to make sure this never happens again. It's a little scary that we haven't been testing capabilities. Also scary: this PR requires python, for converting yaml to json. I think that should be safe: python3 'import yaml' and 'json' works fine on a RHEL8.7 VM from 1minutetip. Signed-off-by: Ed Santiago <[email protected]>
6749958
to
09ef6fc
Compare
@containers/podman-debbuild-maintainers PTAL. This has been drastically changed since my first attempt. I've updated the commit message and github description accordingly. My first iteration did a line-by-line comparison of the YAML: this is impossible for two reasons:
So the new approach converts yaml to json (using python), then uses Removing the workaround from Thanks @mheon for the CONTAINERS_CONF insight. That was the key. |
LGTM. YAML->JSON sounds horrifying but it doesn't look at that bad in the test itself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This exposed a nasty bug in our system-test setup: Ubuntu (runc)
was writing a scratch containers.conf file, and setting CONTAINERS_CONF
to point to it. This was well-intentionedly introduced in #10199 as
part of our long sad history of not testing runc. What I did not
understand at that time is that CONTAINERS_CONF is dangerous:
it does not mean "I will read standard containers.conf and then
override", it means "I will IGNORE standard containers.conf
and use only the settings in this file"! So on Ubuntu we were
losing all the default settings: capabilities, sysctls, all.
Yes, this is documented in containers.conf(5) but it is such
a huge violation of POLA that I need to repeat it.
In #14972, as yet another attempt to fix our runc crisis, I
introduced a new runc-override mechanism: create a custom
/etc/containers/containers.conf when OCI_RUNTIME=runc.
Unlike the CONTAINERS_CONF envariable, the /etc file
actually means what you think it means: "read the default
file first, then override with the /etc file contents".
I.e., we get the desired defaults. But I didn't remember
this helpers.bash workaround, so our runc testing has
actually been flawed: we have not been testing with
the system containers.conf. This commit removes the
no-longer-needed and never-actually-wanted workaround,
and by virtue of testing the cap-drops in kube generate,
we add a regression test to make sure this never happens
again.
It's a little scary that we haven't been testing capabilities.
Also scary: this PR requires python, for converting yaml to json.
I think that should be safe: python3 'import yaml' and 'json'
works fine on a RHEL8.7 VM from 1minutetip.
Signed-off-by: Ed Santiago [email protected]