20147 Commits

Author SHA1 Message Date
cbb955811c Merge pull request #19245 from mheon/fix_19237
Ensure HC events fire after logs are written
2023-09-11 19:47:37 +02:00
5e8c75e4a9 Merge pull request #19926 from edsantiago/e2e_check_stderr__clone
e2e: container_clone_test.go: use ExitCleanly()
2023-09-11 19:32:08 +02:00
325736fcb7 Merge pull request #19914 from umohnani8/term
Add support for kube TerminationGracePeriodSeconds
2023-09-11 19:24:18 +02:00
fd886d6579 Merge pull request #19927 from giuseppe/move-oom-clamp-at-start-time
libpod: move oom_score_adj clamp to init
2023-09-11 19:21:40 +02:00
19bd9b33dd libpod: move oom_score_adj clamp to init
commit 8b4a79a744ac3fd176ca4dc0e3ae40f75159e090 introduced
oom_score_adj clamping when the container oom_score_adj value is lower
than the current one in a rootless environment.  Move the check to
init() time so it is performed every time the container starts and not
only when it is created.  It is more robust if the oom_score_adj value
is changed for the current user session.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-11 17:04:37 +02:00
3a4be5e904 e2e: container_clone_test.go: use ExitCleanly()
Ongoing steps toward RUN-1907: replace Exit(0) with ExitCleanly()

Clean command-line replace, with manual tweaks to two tests:

 * clone to a pod: revert to just Exit(0), because podman issues
   a namespace warning

 * --destroy --force : run "top" in container, not default (shell),
   to avoid the 10-second SIGKILL fallback warning

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-11 07:59:32 -06:00
925794c6aa Ensure HC events fire after logs are written
HC events were firing as part of the `exec` call, before it had
even been decided whether the HC succeeded or failed. As such,
the status was not going to be correct any time there was a
change (e.g. the first event after a container went healthy to
unhealthy would still read healthy). Move the event into the
actual Healthcheck function and throw it in a defer to make sure
it happens at the very end, after logs are written.

Ignores several conditions that did not log previously (container
in question does not have a healthcheck, or an internal failure
that should not really happen).

Still not a perfect solution. This relies on the HC log being
written, when instead we could just get the status straight from
the function writing the event - so if we fail to write the log,
we can still report a bad status. But if the log wasn't written,
we're in bad shape regardless - `podman ps` would disagree with
the event written, for example.

Fixes #19237

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-09-11 08:02:46 -04:00
adc45ef887 Merge pull request #19916 from eriksjolund/fix-docs-podman-systemd-unit-equivalents
[CI:DOCS] podman-systemd.unit: fix equivalents
2023-09-11 11:19:28 +02:00
65a64da271 [CI:DOCS] podman-systemd.unit: fix equivalents
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-09-11 07:41:10 +02:00
8acd66c115 Merge pull request #19888 from giuseppe/fix-pod-lifecycle
fix pod cgroup lifecycle
2023-09-10 20:36:21 -04:00
d9a85466a0 Add support for kube TerminationGracePeriodSeconds
Add support to kube play to support the TerminationGracePeriodSeconds
fiels by sending the value of that to podman's stopTimeout.
Add support to kube generate to generate TerminationGracePeriodSeconds
if stopTimeout is set for a container (will ignore podman's default).

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-09-10 16:41:24 -04:00
8d37db75ad Merge pull request #19910 from Daskan/main
[CI:DOCS] Update podman-kube-play.1.md.in
2023-09-10 20:49:58 +02:00
51d01dd38e Merge pull request #19907 from n1hility/breakout-altbuild
Split up alt binaries to speed up build
2023-09-10 05:49:09 +02:00
5eb0a53a0a Update podman-kube-play.1.md.in
To avoid the error:
`Error: unable to read YAML as Kube Pod: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field Container.spec.containers.command of type string`

Also makes it easier to understand as you only need the image parameter.

Signed-off-by: Daskan <kevin81991@web.de>
2023-09-09 21:41:41 +02:00
92bdd912b2 Merge pull request #19891 from edsantiago/run_rmi_warn
run --rmi: "cannot remove" is a warning, not an error
2023-09-09 10:20:49 -04:00
745201ea23 Merge pull request #19902 from giuseppe/fix-pod-run-with-mounts
pod: fix duplicate volumes from containers.conf
2023-09-09 10:09:25 -04:00
c2cd93cdc2 Split up alt binaries to speed up build
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-09-08 23:57:20 -05:00
7bf9f302a3 Switch installer task to EC2
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-09-08 21:36:39 -05:00
ab5ca5b69c Merge pull request #19895 from edsantiago/ci_test_skipper_fix
CI test runner: upgrade tests rely on system tests
2023-09-08 11:36:48 -04:00
fbbad04398 pod: fix duplicate volumes from containers.conf
If some volumes are specified in containers.conf, they are currently
added twice to the containers spec causing the container to fail:

$ head -n2 ~/.config/containers/containers.conf
[containers]
volumes = ["/tmp:/tmp"]
$ podman pod create --name foo
7ac7f97f9b74a596332483e4a13e58cb9c8d997e9c5baae46804ae0acc26cbc6
$ podman run --pod=foo alpine true
Error: "/tmp": duplicate mount destination

The fix is to ignore the setting from containers.conf when setting the
pod default configuration.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 16:02:55 +02:00
0c75eac637 tests: add test for pod cgroups
This test checks that the pod cgroups are created and that the limits
set for a pod cgroup are enforced also after a reboot.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
b8f6a12d01 libpod: create the cgroup pod before containers
When a container is created and it is part of a pod, we ensure the pod
cgroup exists so limits can be applied on the pod cgroup.

Closes: https://github.com/containers/podman/issues/19175

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
331b3c216d cmd, specgen: allow cgroup resources without --infra
When the infra container is not created, we can still set limits on
the pod cgroup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
83334fb4e7 specgen: allow --share-parent with --infra=false
This allows to use --share-parent with --infra=false, so that the
containers in the pod can share the parent cgroup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
5de8f4aba0 libpod: allow cgroup path without infra container
a pod can use cgroups without an infra container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
5121c9eb0e libpod: check if cgroup exists before creating it
do not create the pod cgroup if it already exists.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
38209ef49d libpod: refactor platformMakePod signature
accept only the resources to be used by the pod, so that the function
can more easily be used by a successive patch.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
627ac1c96b libpod: destroy pod cgroup on pod stop
When the pod is stopped, we need to destroy the pod cgroup, otherwise
it is leaked.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:48 +02:00
9a347619d8 utils: export MoveUnderCgroup
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:47 +02:00
556db46a68 libpod: refactor code to new function
move the code to remove the pod cgroup to a separate function.  It is
a preparation for the next patch.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-08 14:58:44 +02:00
f8e1ec731e Merge pull request #19897 from edsantiago/e2e_check_stderr_checkpoint
e2e: use ExitCleanly() in checkpoint tests
2023-09-08 06:57:57 -04:00
7524753efb Merge pull request #19896 from baude/issue17019
[CI:DOCS]Remove use of --latest|-l from tutorial
2023-09-08 06:56:40 -04:00
6ee8f73d41 Merge pull request #19885 from rhatdan/kube
Add support for kube  securityContext.procMount
2023-09-08 06:56:05 -04:00
5d6ec27e95 Merge pull request #19892 from edsantiago/StopSignal_default_name
StopContainer: display signal num when name unknown
2023-09-08 11:42:34 +02:00
65bddfcd25 e2e: use ExitCleanly() in checkpoint tests
Ongoing steps toward RUN-1907: replace Exit(0) with ExitCleanly()

Clean command-line replace, with one manual reversion (commented)

And -- duh! -- skip the stderr check on Debian!

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 20:20:28 -06:00
4796802320 [CI:DOCS]Remove use of --latest|-l from tutorial
Remove the use of the "latest" flags because it cannot be used on
windows or mac.

Fixes #17019

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-07 17:57:34 -05:00
afeab39d10 CI test runner: upgrade tests rely on system tests
Prevent future occurrences of #19894, by making upgrade tests
run any time there's a change to system tests. That's overly
broad: upgrade tests only rely on test/system/helpers.bash,
not test/system/anything-else. IMHO the cost of CI breaking
is higher than the cost of running unnecessary jobs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 16:50:40 -06:00
c0d36b8ab8 Merge pull request #19894 from edsantiago/urgent_ci_fix
URGENT: fix broken CI
2023-09-07 17:49:13 -05:00
59bd6a74a0 run --rmi: "cannot remove" is a warning, not an error
When the "rmi" part of "run --rmi" fails due to image being in use
by another container (or for any reason, actually), issue a warning
message, not an error.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 14:30:22 -06:00
70cf9740f1 StopContainer: display signal num when name unknown
Under some circumstances podman tries to kill a container
using signal 37, for which unix.SignalName() returns "".
Not helpful. So, when that happens, show "(signal number)".

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 14:13:14 -06:00
6f913f5f37 URGENT: fix broken CI
PR #19878 (checking for warnings in system tests) broke upgrade tests.

Reason: my long-ago "optimization" in which, if a PR touches only
tests in X, do not run tests in Y. Unfortunately, upgrade tests
rely on code in the system-test directory. I don't know if this
is fixable; nor if it's an acceptable tradeoff. Please discuss.

Sorry, everyone.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 14:05:30 -06:00
e546aebb32 Merge pull request #19889 from vrothberg/restart-kill
podman: don't restart after kill
2023-09-07 21:28:17 +02:00
0c72726f01 Merge pull request #19878 from edsantiago/bats_check_stderr
sys tests: run_podman: check for unwanted warnings/errors
2023-09-07 17:26:59 +02:00
16f2dd36bb Merge pull request #19887 from rhatdan/kube1
Tmpfs should not be mounted noexec
2023-09-07 16:19:24 +02:00
b83485022d Add support for kube securityContext\.procMount
Fixes: https://github.com/containers/podman/issues/19881

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-07 09:49:11 -04:00
589867d716 podman: don't restart after kill
Also add a new `StoppedByUser` field to the container-inspect state
which can be useful during debugging and is now also used in the
regression test.  Note that I moved the `false` check one test above
such that we can compare the previous Podman version which should just
be stuck in the `wait $ctr` command since it will continue restarting.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-07 15:18:02 +02:00
2d7d8d1d10 Tmpfs should not be mounted noexec
The logic here makes little sense, basically the /tmp and /var/tmp are
always set noexec, while /run is not.  I don't see a reason to set any
of the three noexec by default.

Fixes: https://github.com/containers/podman/issues/19886

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-07 08:06:55 -04:00
c2575f726d sys tests: run_podman: check for unwanted warnings/errors
With few exceptions, commands that exit 0 should not emit any
messages with level=warning or =error. Let's start enforcing
that in run_podman.

Allow one-off exceptions, typically when we're testing an
actual warning condition (usual case: "podman stop" where it
times out to SIGKILL). Exceptions are specified via:

    run_podman 0+w subcommand...
               ^^^---- or, rarely, 0+e

"0" stands for "expect exit status 0", which is the default
so it's implicit anyway. The +w / +e (or even +we) is the
new part. I have added it to tests where necessary.

And, because life is what it is, add two global exceptions:

  - Debian. Because runc has too many flakes.
  - kube. Ditto. Kube commands emit lots of nasty error
    messages (yes, level=error) that don't seem to affect
    results.

Similar to #18442

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-07 05:35:21 -06:00
c17c190f89 Merge pull request #19882 from edsantiago/e2e_exitcleanly
e2e: use ExitCleanly() in attach & build tests
2023-09-07 12:27:05 +02:00
24e9e946cc Merge pull request #19883 from containers/renovate/setuptools-68.x
chore(deps): update dependency setuptools to ~=68.2.0
2023-09-07 06:23:28 -04:00