Commit Graph

23040 Commits

Author SHA1 Message Date
renovate[bot] 742d29e9d8
Update module github.com/vbauerster/mpb/v8 to v8.7.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 15:19:17 +00:00
openshift-merge-bot[bot] db6f7d5e82
Merge pull request #23341 from Luap99/stats-err
podman stats: fix race when ctr process exists
2024-07-20 10:26:19 +00:00
openshift-merge-bot[bot] 5e47444a9e
Merge pull request #23342 from slp/update-krunkit-0.1.2
Bump bundled krunkit to 0.1.2
2024-07-19 13:40:35 +00:00
Sergio Lopez 5a7199015a
Bump bundled krunkit to 0.1.2
Bump the bundled krunkit version from 0.1.1 to 0.1.2.

Fixes: #23194

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-07-19 13:35:49 +02:00
Paul Holzinger 55749af0c7
podman stats: fix race when ctr process exists
stats read from the cgroup, and in order to know the cgroup we check the
pid for the cgroup. However there is a window where the pid exited and
podman did not yet updated its internal state. In this case the code
returns ErrCtrStopped so we should ignore this error as well.

Fixes #23334

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-19 13:21:34 +02:00
openshift-merge-bot[bot] 8a53e8eb67
Merge pull request #23323 from Luap99/machine-decompress-empty
pkg/machine/compression: skip decompress bar for empty file
2024-07-18 17:51:11 +00:00
openshift-merge-bot[bot] 164ecb2b5e
Merge pull request #23325 from Luap99/ps-pod-err
podman ps: fix racy pod name query
2024-07-18 17:48:26 +00:00
openshift-merge-bot[bot] 73986f67a3
Merge pull request #23313 from edsantiago/safename-kube-tests
CI: 700-play.bats: huge cleanup, with goal of making parallel-safe
2024-07-18 17:45:40 +00:00
openshift-merge-bot[bot] ea7ee59571
Merge pull request #23310 from edsantiago/nc-dash-p-considered-harmful
nc -p considered harmful
2024-07-18 17:29:10 +00:00
openshift-merge-bot[bot] 9f873256b6
Merge pull request #23316 from umohnani8/farm-fix
Fix name for builder in farm connection
2024-07-18 17:26:24 +00:00
openshift-merge-bot[bot] 964b9a25ad
Merge pull request #23326 from Luap99/connection-remove-args
system connection remove: use Args function to validate
2024-07-18 16:42:25 +00:00
Paul Holzinger 182224defb
podman pod stats: fix pod rm race
If a pod is removed when calling podman pod stats there is a race where
the command might fail with no such pod. This is not a user error, like
the ps/ls command skip it and move to the next one.

Fixes #23327

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 17:48:21 +02:00
Paul Holzinger e1caf80e81
podman ps: fix racy pod name query
The pod name was queried without holding the container lock, thus it was
possible that the pod was deleted in the meantime and podman just failed
with "no such pod" as the errors.Is() check matched the wrong error.

Move it into the locked code this should prevent anyone from removing
the pod while the container is part of it. Also fix the returned error,
there is no reason to special case one specific error just wrap any error
here so callers at least know where it happened. However this is not
good enough because the batch doesn't update the state which means it
see everything before the container was locked. In this case it might be
possible the ctr and pod was already removed so let the caller skip both
ctr and pod removed errors.

Fixes #23282

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 17:34:26 +02:00
Paul Holzinger 85f4f89810
system connection remove: use Args function to validate
Using the ExactArgs(1) function is better because we have less
duplication of the error text and the ValidArgsFunction uses that to
suggest shell completion. The command before this commit would suggest
connection names even if there was already one arg on the cli set.

However because there is the --all option we still must exclude that
first.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 16:37:37 +02:00
openshift-merge-bot[bot] eecdba4009
Merge pull request #23304 from rhatdan/gpus
Remove references and checks for --gpus
2024-07-18 12:21:10 +00:00
openshift-merge-bot[bot] 22cf2b42d4
Merge pull request #23305 from Luap99/auto-update-race
podman auto-update/system df: fix ErrNoSuchCtr/Volume race
2024-07-18 11:31:46 +00:00
Paul Holzinger f630eebcfa
pkg/machine/compression: skip decompress bar for empty file
When the file is empty it is possible our code panics as bar.ProxyReader
returns nil when the bar is finished which is the case for 0 size as it
doesn't have to read anything from there. However as this happens on
different goroutines it is race and most of the time still works.

To fix this simply skip the progress bar setup for empty files.

While at it fix the deprecated argument in the tests.

Fixes #23281

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 13:23:00 +02:00
Ed Santiago 7100ead475 nc -p considered harmful
nmap-ncat has been downgraded on Fedora, to 7.92.
nc -l -p PORT requires 7.95. Switch to nc -l ADDR PORT.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-18 05:15:57 -06:00
openshift-merge-bot[bot] 599967bf9f
Merge pull request #23265 from benniekiss/extended_drop_ins
Expand Quadlet drop-in search paths
2024-07-18 09:49:55 +00:00
openshift-merge-bot[bot] aaa7138cdb
Merge pull request #23311 from containers/renovate/setuptools-71.x
chore(deps): update dependency setuptools to v71
2024-07-18 09:25:10 +00:00
Paul Holzinger 46f4044893
podman system df: fix fix ErrNoSuchCtr/Volume race
When a container or volume is removed during the loop this is not a
problem and we should just skip it as it is not a user bug and just a
normal race.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 10:52:25 +02:00
Paul Holzinger 1413a28409
podman auto-update: fix ErrNoSuchCtr race
If a container is removed during the loop we should just ignore it. No
reason to log this as error to the user.

Fixes #23279

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-18 10:52:12 +02:00
Urvashi Mohnani 02c094425f Fix name for builder in farm connection
Ensure that the map of builders we create links the
builder name and not the farm name to the image engine
of that node. This was a regression introduced during the
farm conf rework.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-07-17 22:31:48 -04:00
Ed Santiago 2f7fd64e98 700-play.bats: use unique pod/container/image/volume names
The end goal is making this test file parallel-safe, by:

  1) Having all tests use unique names for all objects; and
  2) Not doing "rm -a" or "expect ps to be empty".

This commit is not enough to make tests parallel-safe. The
rest of the changes are not relevant for now. This set of
changes is _necessary_ for parallelizing, and is _meaningful_
(good practice) for current linear-testing podman without
introducing any unnecessary cruft.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 380ed3a40d safename: consistent within same test, and, dashes
Make safename() invocations consistent within the same
test. This puts the onus on the caller to add a unique
element when calling multiple times, e.g. "ctr1-$(safename)".
This is not too much of a burden. Major benefit is making
it easy for a reader to associate containers, pods, volumes,
images within a given test.

And, use dashes, not underscores. "podman generate kube"
removes underscores, making it very difficult to do
things like "podman inspect $podname" (because we need
to generate "$podname_with_underscores_removed")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 6d01ce417d 700-kube.bats: refactor $PODMAN_TMPDIR/test.yaml
Many instances. Simplify by having _write_test_yaml() define
the variable TESTYAML and make it available to callers.
Global replace, with care taken to undo any instances
where _write_test_yaml() is not invoked first.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 987d15a378 700-play.bats: eliminate $testYaml
Get rid of the last two instances of the clunky $testYaml
writing, by adding a 'volume=' arg to _write_test_yaml()

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 48aea083c0 700-play.bats: refactor clumsy yamlfile creation
Remnant from the very early days of this test file. There's
a boilerplate $testYaml string used in many tests; each
use requires three clunky lines of prep. Most of those
were not needed; we can (and now do) use _write_test_yaml()
instead.

There are still two instances that could not be fixed in
this commit. I will do those next. This commit is kept
relatively simple for ease of review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 517c6e6f10 700-play.bats: move _write_test_yaml up near top
This is almost a NOP; it's needed for making subsequent commits
reviewable.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
renovate[bot] ed71000e6d
chore(deps): update dependency setuptools to v71
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 22:13:43 +00:00
benniekiss 3c52ef43f5 Expand drop-in search paths
* top-level (pod.d)
* truncated (unit-.container.d)

Signed-off-by: Bennie Milburn-Town <63211101+benniekiss@users.noreply.github.com>
2024-07-17 17:43:02 -04:00
openshift-merge-bot[bot] 89432899a7
Merge pull request #23299 from containers/renovate/github.com-rootless-containers-rootlesskit-v2-2.x
fix(deps): update module github.com/rootless-containers/rootlesskit/v2 to v2.2.0
2024-07-17 20:26:50 +00:00
openshift-merge-bot[bot] 9f47319a72
Merge pull request #23137 from rhatdan/image
Do not crash on invalid filters
2024-07-17 16:45:30 +00:00
Daniel J Walsh 5666100c2e
Remove references and checks for --gpus
No way to test this unless running on a nvidia platform.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 12:02:51 -04:00
Daniel J Walsh 1ec3edd3f6
Do not crash on invalid filters
Vendor in latest containers/common
Fixes #23120

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 10:44:55 -04:00
renovate[bot] 692d2a5b08
fix(deps): update module github.com/rootless-containers/rootlesskit/v2 to v2.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 04:11:53 +00:00
openshift-merge-bot[bot] 555763c2a5
Merge pull request #23280 from edsantiago/bats-safename
System tests: safe container/image/volume/etc names
2024-07-16 18:01:13 +00:00
openshift-merge-bot[bot] e225cae781
Merge pull request #23145 from afbjorklund/remove-machine-volume-driver
Remove the unused machine volume-driver
2024-07-15 20:36:19 +00:00
Anders F Björklund f3e945c86e Keep the volume-driver flag deprecated
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2024-07-15 21:41:34 +02:00
openshift-merge-bot[bot] 07f0e4fe04
Merge pull request #23278 from rhatdan/VENDOR
Vendor in latest containers(common, storage,image, buildah)
2024-07-15 19:19:23 +00:00
Daniel J Walsh eb750f61f6
Vendor in latest containers(common, storage,image, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-15 13:51:43 -04:00
Ed Santiago b28027148b System tests: safe container/image/volume/etc names
Many system tests use hardcoded names for containers, images,
and everything. This has worked because system tests run
serially. It will not work if we ever run in parallel.

Create a new safename() helper, and use it as follows:

   myctr=c_$(safename)
   myvol1=v1_$(safename)
   ...

Find current instances of hardcoded names, and replace
with safe ones.

Whether or not we ever end up parallelizing system tests,
this is simply good practice.

There are far too many instances to fix in one (reviewable) PR.
This is commit 1 of N.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-15 11:38:00 -06:00
openshift-merge-bot[bot] 88c68a4b58
Merge pull request #23271 from giuseppe/drop-unmount-for-overlay-storage
test: podman system service doesn't leak mount on termination
2024-07-15 12:20:11 +00:00
openshift-merge-bot[bot] 2f673aa8f7
Merge pull request #23258 from Luap99/start-error
fix race conditions in start/attach logic
2024-07-15 12:11:56 +00:00
openshift-merge-bot[bot] 1d7439eb06
Merge pull request #23270 from passcod/patch-1
Add NetworkAlias= support for quadlet .container and .pod files
2024-07-15 10:29:14 +00:00
Giuseppe Scrivano b08b630c84
test: drop unmount for overlay
The unmount for the driver home dir is done automatically by the store
on Shutdown.  Do not do the unmount from the tests cleanup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano e16e528f39
test: gracefully terminate server
send a SIGTERM to the server process instead of killing it so it has
time to do a proper cleanup and don't leak the home mount.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano fbc4768a00
libpod: shutdown Stop waits for handlers completion
wait for handlers currently being processed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano 6832a35f65
libpod: cleanup store at shutdown
shutdown the containers store so that the home directory mount is not
leaked when "podman system service" exits.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Félix Saparelli 54fce37968
Add NetworkAlias= support to quadlet
Adds a `NetworkAlias=` key to both .container and .pod quadlet files,
which translates to the `--network-alias` option to `podman run` and
`podman pod create` respectively. Can be repeated multiple times.

Signed-off-by: Félix Saparelli <felix@passcod.name>
2024-07-15 16:39:25 +12:00