Commit Graph

6576 Commits

Author SHA1 Message Date
Ygal Blum 91a5c0de2a Quadlet - use specifier for unescaped values for templated container name
The escaped version replaces - with / which creates an invalid container name
See https://github.com/containers/podman/issues/22874#issuecomment-2175559746

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-06-19 14:44:21 +03:00
Paul Holzinger 4e0cd49148
test/system: check for leaks in teardown suite
At the end of all tests always check for leaks. That should make us more
robust against adding tests at the end that would leak stuff otherwise.

TODO: something seems wrong with bats when returning an error in
teardown_suite(), it prints a warning:
bats warning: Executed <NUM+1> instead of expected <NUM> tests
And also the output is formatted weirdly in this case where the podman
args are split over multiple lines.
But the test fails as expected so I don't think it is a problem.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-18 11:06:51 +02:00
Paul Holzinger 81c90f51c2
test/system: speed up basic_{setup,teardown}()
While these are not really slow they still take about 100-250ms if I
time this locally. Given they are run for every test this adds up
quickly. Looking at CI logs I can see the timings for skipped
tests are all in 600ms range. So I think it is safe to assume that these
functions need to get faster.

We have over 670 test cases currently so we talk about over 400s spend
in these functions in CI. This allows for big gains.

Now overall this is a tricky trade of, while all tests should cleanup
after themselves there is no guarantee for that as such errors can be
leaked into other tests making debugging much harder. To work at least a
bit against this teardown checks if the test was successful and only
skips the podman commands bases on that. Without it a single flake could
cause all following tets to fail.

As such this commit does the proper setup once one suite start then only
after a test failed.

In order for this to work at all we have to fix all leaks first, see
previous commits. And then for the future keep a very strong eye on
this during reviews.

Also add a PODMAN_BATS_LEAK_CHECK option

By default test must cleanup themselves and to speed up CI we no longer
do any cleanup in teardown by default. However there is still many cases
where we might have to debug a leak so add a new PODMAN_BATS_LEAK_CHECK
env option that can be set and should cause teardown to fail if the test
did not cleanup properly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-18 11:06:50 +02:00
Paul Holzinger a2352fa3ea
test/system: fix up many tests that do not cleanup
All tests should cleanup themselves and not leak stuff.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-18 11:06:49 +02:00
Paul Holzinger e9c6cd1559
test/system: fix podman --authfile=nonexistent-path
Remove leaking containers and remove unessesary push/pull args. For push
it tries to push an image as argument which makes no sense and for pull
we try to pull argument as image which is also wrong.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-18 11:06:47 +02:00
openshift-merge-bot[bot] 00bcd9aa81
Merge pull request #22733 from nalind/system-check
Add `podman system check`
2024-06-13 10:35:56 +00:00
Daniel J Walsh 64091777fe
Remove references to --pull=true and --pull=false
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-12 18:16:29 +02:00
Ed Santiago 267d838e38 ExitWithError, continued
Low-hanging fruit: Exit(X) with no error message
is now ExitWithError(X, "")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-12 08:48:19 -06:00
openshift-merge-bot[bot] 798beb47ec
Merge pull request #22694 from jmaibaum/quadlet-build
Quadlet: Add support for .build files
2024-06-11 20:41:28 +00:00
openshift-merge-bot[bot] f79ede86c6
Merge pull request #22914 from Luap99/start-stopped
libpod: do not reuse networking on start
2024-06-11 19:18:55 +00:00
Daniel J Walsh ad8fc6a74b
--squash --layers=false should be allowed
This is the same as what --squash-all is doing, and we already support
--squash with --layers=true since this is the default.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-10 13:24:05 -04:00
Paul Holzinger a9de888a15
libpod: do not resuse networking on start
If a container was stopped and we try to start it before we called
cleanup it tried to reuse the network which caused a panic as the pasta
code cannot deal with that. It is also never correct as the netns must
be created by the runtime in case of custom user namespaces used. As
such the proper thing is to clean the netns up first.

Also change a e2e test to report better errors. It is not directly
related to this chnage but it failed on v1 of this patch so we noticed
the ugly error message it produced. Thanks to Ed for the fix.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-07 17:50:28 +02:00
Ed Santiago f317eb29ab ExitWithError() - continued
Convert Exit(N) to ExitWithError(N, "expected error")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-06 12:00:16 -06:00
openshift-merge-bot[bot] c3728a50e6
Merge pull request #22908 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.22.0
2024-06-05 14:52:52 +00:00
openshift-merge-bot[bot] 42ffa4db43
Merge pull request #22886 from Luap99/fast-system-test-3
test/system: make some tests faster part 3
2024-06-05 13:19:00 +00:00
renovate[bot] f4b14c11ef
fix(deps): update module golang.org/x/tools to v0.22.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-05 10:59:51 +00:00
openshift-merge-bot[bot] b63767866e
Merge pull request #22895 from Luap99/hc-startup-leak
libpod: do not leak systemd hc startup unit timer
2024-06-04 17:41:21 +00:00
openshift-merge-bot[bot] 37339f5a30
Merge pull request #22859 from ut-wangbo/hostname-new-line
libpod: hostname written to /etc/hostname ends with a newline character
2024-06-04 17:12:53 +00:00
Paul Holzinger e8ea1e7632
libpod: do not leak systemd hc startup unit timer
This fixes a regression added in commit 4fd84190b8, because the name was
overwritten by the createTimer() timer call the removeTransientFiles()
call removed the new timer and not the startup healthcheck. And then
when the container was stopped we leaked it as the wrong unit name was
in the state.

A new test has been added to ensure the logic works and we never leak
the system timers.

Fixes #22884

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 18:03:46 +02:00
Paul Holzinger 350dfabf66
test/system: speed up podman ps --external
The buildah buil kill trick is bad as we have to sleep and wait to aboid
flakes which takes time. Instead it is possible to redo this build part
manually with buildah commands. It is not trival and harder to
understand but it safes 2-3s so I think it is worth it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:01 +02:00
Paul Holzinger 8fa1ffbbec
test/system: speed up podman network connect/disconnect
Combine multiple inspect --format into one, it is not much but is makes
it faster by a few 100 ms.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:01 +02:00
Paul Holzinger 8640ce998c
test/system: speed up podman network reload
First, as root don't wait 5s for the timeout, 1s is enough. Also switch
to use the curl --max-time option instead, that way we know we do not
kill curl before it had the chance to do anything possibly.

Second, combine podman inspect commands into one. This makes the test
faster by over one second as we safe a bunch of podman commands.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 609146fb75
test/system: speed up quadlet - pod simple
Another case of contianer does not exit with SIGTERM so we waste 10s.
Now because our contianer reacts to sigterm and exits 0 the systemd unit
status changed to inactive from failed.
And most importantly add Notify=yes because the socat call always failed
as the default is to not leak the notify socket into the container.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 7f3bb2d238
test/system: speed up podman parallel build should not race
It is not clear at all why the count of 30 was choosen, this seems a
lot and of course takes quite a while. The test takes over 16s in CI.
To speed it up reduce the count to 10. I think this should still be good
enough to ensure there are no races IMO.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 8852614792
test/system: speed up podman cp dir from host to container
It makes the test a bit uglier but I cannot see a good way to sped this
up otherwise. I chnaged the created test to only start/stop the
contianer once instead of every test case iteration. This makes it about
2s faster locally.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 8d3f65b026
test/system: speed up podman build - workdir, cmd, env, label
Overall just combine several container runs into one. Every RUN
instruction will run a new container which is quite expensive so chain
the commands together. The same for podman run's.
I could have combined a bit more but I think this leaves it still
readable. This speeds up the test about 4s locally from 8s before.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 471e001c7f
test/system: speed up podman --log-level recognizes log levels
Use podman version over podman info because info has to query a lot of
internal state, e.g. contianer and image count, so it is slower than a
simple info. This speeds the test up by about 600ms locally.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:24:00 +02:00
Paul Holzinger 26bdb5d110
test/system: remove obsolete debug in net connect/disconnect test
Issue #11825 was fixed a long time ago. Also we no longer test
cni/dnsname so there is really no point in having this.
Speeds up the test by 1 second.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:23:59 +02:00
Paul Holzinger c466377013
test/system: speed up quadlet - basic
Another case of contianer does not exit with SIGTERM so we waste 10s.
Now because our contianer reacts to sigterm and exits 0 the systemd
unit status changed to inactive from failed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:23:59 +02:00
Paul Holzinger 6b021dd4ba
test/system: speed up user namespace preserved root ownership
We don't have two loop twice for the stat call we can just stat both
dirs at once. This means we only have to create half of the containers
so the test is twice as fast.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-04 16:23:59 +02:00
Nalin Dahyabhai 2e70d4201f System tests: add `podman system check` tests
Testing `podman system check` requires that we have a way to
intentionally introduce storage corruptions.  Add a hidden `podman
testing` command that provides the necessary internal logic in
subcommands.  Stub out the tunnel implementation for now.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-06-04 10:00:37 -04:00
Bo Wang 7243c7109c fix(libpod): add newline character to the end of container's hostname file
debian's man (5) hostname page states "The file should contain a single newline-terminated hostname
string."
[NO NEW TESTS NEEDED]

fix #22729

Signed-off-by: Bo Wang <wangbob@uniontech.com>
2024-06-04 15:20:04 +08:00
openshift-merge-bot[bot] 241821b77d
Merge pull request #22707 from rhatdan/stats
Fail earlier when no containers exist in stats
2024-06-03 15:55:48 +00:00
openshift-merge-bot[bot] d78ffd9ccc
Merge pull request #22766 from containers/renovate/requests-2.x
chore(deps): update dependency requests to ~=2.32.3
2024-06-03 15:42:00 +00:00
Paul Holzinger 164573dc34
test/e2e: use local skopeo not image
The e2e tests already depend on skopeo anyway and pulling a over 300
MB image is not helpful for flakes but most importantly we see ENOSPC
flakes. I see them around the skopeo test so I assume the big image is
pushing the tmpfs limits so other tests running in parallel can start
failing because of it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-03 12:26:59 +02:00
renovate[bot] b146f9126a
chore(deps): update dependency requests to ~=2.32.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-31 13:12:50 +00:00
Giuseppe Scrivano 900e29549a
libpod: do not move podman with --cgroups=disabled
The expectation with --cgroups=disabled is that the current cgroup is
used by the container.

Currently the --cgroups=disabled is passed directly to the OCI
runtime, but it doesn't stop Podman from creating a new cgroup when it
doesn't own the current one.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-30 16:59:30 +02:00
Giuseppe Scrivano 5dc1738c05
test: look at the file base name
make the test more robust when an absolute path is used.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-29 22:21:21 +02:00
Giuseppe Scrivano 6243f5cebe
tests: simplify expected output
the condition doesn't work when the runtime to use is specified
through its absolute path as the error message contains that.

Simplify the check and just look for "read from the init process".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-29 22:00:03 +02:00
openshift-merge-bot[bot] 846d717c0b
Merge pull request #22826 from Luap99/fast-system-test-2
test/system: make some tests faster part 2
2024-05-29 12:59:09 +00:00
Daniel J Walsh 4adb5cbbff
Fail earlier when no containers exist in stats
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-05-29 06:38:56 -04:00
Paul Holzinger ad661b5b31
test/system: speed up kube generate tmpfs on /tmp
The command does not react on sigterm, so kube down needs to wait 10s.
To fix it first use a command that does but also write the yaml
directly instead of doing the podman create && kube generate dance.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:01:16 +02:00
Paul Holzinger bff0697de8
test/system: speed up podman kube play tests
use a command that stops on SIGTERM not sleep, that way the tests can
continue to use podman kube down without waiting for the full stop
timeout every time.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:01:16 +02:00
Paul Holzinger 67356a71b3
test/system: speed up podman shell completion test
This test is by far the slowest one taking over minute, the reason is
that it is checking every single podman command for shell completions.
The test is useful but it does not need to check the "..." argument 3
times. Test a second time to make sure not only the first arg is
completed. This change makes it about 15 seconds faster.

Long term we should get this test out of the main system tests together
with other cli only tests as they do not need to run on each OS, etc...

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:01:15 +02:00
Paul Holzinger 01642c64ea
test/system: simplify test signal handling in containers
The current logic used podman logs I don't understand way, all we care
about is the container output and we can just read the same with a
attached podman run, of course we have to move it into the background
but it did the some with logs.

This also allows us to remove the extra log-driver checks and because
podman logs seems to be much slower than the extra run we safe over 10s
with this change.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:01:15 +02:00
Paul Holzinger 6fa064f991
test/system: speed up podman container rm ...
Use only one retry and a short stop timeout to speed them up. I am not
sure if this will cause flakes, I have not seen any after trying for
some time so I think this works just as well. And is about 2-3 seconds
faster for both tests.

If it does start to flake we can revert this commit again or write the
test differently.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:00:51 +02:00
Paul Holzinger 37120bbe80
test/system: speed up podman ps - basic tests
Do not wait 5 seconds, just stop the container directly.
This speeds up the test by more than 4 seconds.

One could make the case here that we want to check podman wait but
there are so many other podman wait tests that it should not matter.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:00:39 +02:00
Paul Holzinger 4f3c691087
test/system: speed up read-only from containers.conf
Instead of iterating over all tmp dirs and creating test containers for
each one we can just pass all files to one touch call. With that we have
to create much less containers while still checking the same thing. This
speeds up the test by about 4 seconds.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:00:39 +02:00
Paul Holzinger edf6f1814e
test/system: speed up podman logs - multi ...
The test used sleep to synchronize log output between both containers
which is slow. There is actually no way to guarantee the ordering on
the reading side so just remove the sleep's and check the the lines
within the same container are in the right order.

Trying to preserve the orignal ordering is just not possible if we speed
up the test as it would flake to often.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 11:00:30 +02:00
Paul Holzinger fe05e25edf
test/system: speed up podman run --name
There is no reason for this check to wait 4 seconds for the container to
run, instead make sure to have a running process and then stop it
directly with -t0 not have any delay.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-29 10:39:51 +02:00
Ed Santiago 1ae05473c1 Debian: switch to crun
As agreed in Planning meeting of 2024-03-20, Podman 5.x will
drop support for cgroups v1 and for runc. Make it so.

CI images built in https://github.com/containers/automation_images/pull/338

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-28 16:34:39 -06:00
openshift-merge-bot[bot] aca5a7b036
Merge pull request #22821 from Luap99/fast-system-test
test/system: make some tests faster part 1
2024-05-28 14:44:40 +00:00
openshift-merge-bot[bot] 6f0737a5c9
Merge pull request #22806 from JayKayy/22590-pod-console-name
Have pod.Name display instead of pod.ID on start and stop reports
2024-05-28 14:19:46 +00:00
openshift-merge-bot[bot] af8fe2b75e
Merge pull request #22764 from giuseppe/give-more-time-to-healthcheck-status-change
libpod: wait another interval for healthcheck
2024-05-28 13:21:43 +00:00
Paul Holzinger 1093ebb72b
test/system: speed up podman generate systemd - envar
This container did not react to sigterm thus we always waited 10s for it
to stop. Also do not wait 2s for the logs instead use a retry loop.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-28 13:53:55 +02:00
Paul Holzinger 15606148e5
test/system: speed up podman-kube@.service template
The test does a normal stop on a command that does not react to sigterm.
As I cannot fix the system stop logic use a command which does. This
safes us 10s as it no longer waits for the timeout.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 18:37:18 +02:00
Paul Holzinger 42f43fb3a3
test/system: speed up kube play healthcheck initialDelaySeconds
Both tests take 10s longer than they need to because they run the sleep
command int he container which does not react to sigterm, as such podman
waits 10s before killing it with sigkill.

To fix it just stop them with podman rm -fa -t0 to avoid the wait and do
not use podman kube down as we cannot set a timeout there. podman kube
down is still covered in many other tests so this is not an issue.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 18:23:25 +02:00
Paul Holzinger 9e321aafda
test/system: speed up exit-code propagation test
IMO it is not important to cover each case with each sdnotify policy, to
speed them up we run all the exit code cases only once just twice for
each policy while switching the sdnotify policy between each case. This
way we safe 50% of runs and should still have sufficient coverage.

Before it took around 24 seconds, with this it is around 12 seconds now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 18:10:07 +02:00
Paul Holzinger 94ba2cf1a1
test/system: speed up "podman run --timeout"
There is really no point in waiting 10s for the kill, let's use 2 this
should be good enough to observe the timing.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 17:51:59 +02:00
Paul Holzinger 82bffb9c50
test/system: fix slow kube play --wait with siginterrupt
This test waits 15 seconds to send sigterm for no good reason, we can
just make the timeout shorter. Also make sure the podman command quit on
sigterm by looking for the output message.

While at it fix the tests to use $PODMAN_TMPDIR not /tmp and define the
yaml in the test instead of using the podman create && podman kube
generate && podman rm way to create the yaml as it is a bit slower as we
have to call three podman commands for it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 17:37:20 +02:00
jkwiatko 7ce3c6bf1e undo auto-formatting
Signed-off-by: jkwiatko <jkwiatkoski@protonmail.com>
2024-05-27 11:33:04 -04:00
Paul Holzinger 9a7ffaa077
test/system: speed up podman events tests
Merge two podman event tests into one to speed them up as they did
mostly the same anyway. This way we only have to do the setup/teardown
once and only run one container.

Second, add the --since option because reading the journal can be slow
if you have thousands of event entries. This is not so critical in CI as
we run on fresh systems but on local dev machines I have almost 100k
events in the journal so parsing all of them makes this test slow (like
30s), with this change I can get it under 1s.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 17:14:28 +02:00
Johannes Maibaum 9f823ecb25 Quadlet: Add support for .build files
.build files allow to build an image via Quadlet. The keys from a .build
file are translated to arguments of a `podman build` command by Quadlet.

Minimal keys for .build files are `ImageTag=` and a context directory,
see `SetWorkingDirectory=`, or a `File=` pointing to a Containerfile.

After sorting .build files into the Quadlet dependency order, there
remains a possible dependency cycle issue between .volume and .build
files: A .volume can have `Image=some.build`, and a .build can have
`Volume=some.volume:/some/volume`.

We solve this dependency cycle by prefilling resourceNames with all
image names from .build files before converting all the unit files.

This results in an issue for the test suite though: For .volume's
depending on *.image or *.build, we need to copy these additional
dependencies to the test's quadletDir, otherwise the test will fail.
This is necessary, because `handleImageSource()` actually needs to know
the image name defined in the referenced *.{build,image} file. It cannot
fall back on the default names, as it is done for networks or volumes,
for example.

Signed-off-by: Johannes Maibaum <jmaibaum@gmail.com>
2024-05-27 16:59:39 +02:00
Paul Holzinger 9de1d4f653
test/system: speed up "podman auto-update using systemd"
Defining a timer with a fixed interval is not a good idea as we first
have to wait until the timer triggers, while the interval was every two
seconds it means that we have to wait at least 2s for it to start.
However much worse it means it triggers the unit over and over, this
seems to cause some soft of race with the output check. I have seen
this test run 10-60s which does not make much sense.

Switching the timer to trgger once on start seem to make the test run
consistently in 7s locally for me so this is much better.

There still is the question if we really have to test this at all on
each upstream PR but I left it for now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 16:20:05 +02:00
Paul Holzinger a09152ab28
test/system: remove podman wait test
It takes over 10 seconds for this test as it uses --wait 5 twice which
runs into the timeout. IMO this tests is just redundant as it is already
covered in the e2e tests much better. Thus remove it here.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-27 15:54:56 +02:00
Giuseppe Scrivano 7f567a4e51
tests: disable tests affected by a race condition
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-27 13:02:26 +02:00
jkwiatko b45364254f working name of pod on start and stop
Signed-off-by: jkwiatko <jkwiatkoski@protonmail.com>
2024-05-25 19:40:21 -04:00
renovate[bot] c5597cb12c
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.19.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-25 16:46:22 +00:00
openshift-merge-bot[bot] e53b96cb25
Merge pull request #22683 from grisu48/podmansh_sh
Add configuration for podmansh
2024-05-23 12:45:05 +00:00
openshift-merge-bot[bot] eee0dc256a
Merge pull request #22727 from mheon/chown_all_the_time
Always chown volumes when mounting into a container
2024-05-23 12:34:07 +00:00
Paul Holzinger db3abd0d28
test/e2e: fix new error message
The new c/image version is returning a slightly new error message[1] so
make tests use the new one.

[1] https://github.com/containers/image/pull/2408

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-23 13:29:39 +02:00
openshift-merge-bot[bot] 36152eeabf
Merge pull request #22057 from jbtrystram/quadlet-image-network
quadlet: Add a network requirement on .image and .containers units
2024-05-23 06:19:07 +00:00
Matthew Heon 046c0e5fc2 Only stop chowning volumes once they're not empty
When an empty volume is mounted into a container, Docker will
chown that volume appropriately for use in the container. Podman
does this as well, but there are differences in the details. In
Podman, a chown is presently a one-and-done deal; in Docker, it
will continue so long as the volume remains empty. Mount into a
dozen containers, but never add content, the chown occurs every
time. The chown is also linked to copy-up; it will always occur
when a copy-up occurred, despite the volume now not being empty.
This PR changes our logic to (mostly) match Docker's.

For some reason, the chowning also stops if the volume is chowned
to root at any point. This feels like a Docker bug, but as they
say, bug for bug compatible.

In retrospect, using bools for NeedsChown and NeedsCopyUp was a
mistake. Docker isn't actually tracking this stuff; they're just
doing a copy-up and permissions change unconditionally as long as
the volume is empty. They also have the two linked as one
operation, seemingly, despite happening at very different times
during container init. Replicating that in our stateful system is
nontrivial, hence the need for the new CopiedUp field. Basically,
we never want to chown a volume with contents in it, except if
that data is a result of a copy-up that resulted from mounting
into the current container. Tracking who did the copy-up is the
easiest way to do this.

Fixes #22571

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2024-05-22 17:47:01 -04:00
Giuseppe Scrivano d094a9f18e
podman: fix --sdnotify=healthy with --rm
Now WaitForExit returns the exit code as stored in the db instead of
returning an error when the container was removed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-22 21:34:38 +02:00
openshift-merge-bot[bot] cc79d5e82e
Merge pull request #22700 from Luap99/libpod-inspect-API-v4
remote API: restore v4 payload in container inspect
2024-05-22 12:32:29 +00:00
openshift-merge-bot[bot] 54cb3673ed
Merge pull request #22776 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.18.0
2024-05-22 12:24:15 +00:00
jbtrystram ad1d3f8fc7
quadlet: Add a network requirement on .image units
If a container unit starts on boot with a dependency on `default.target`
the image unit may start too soon, before network is ready. This cause
the unit to fail to pull the image.
- Add a dependency on `network-online.target` to make sure image pulls
don't fail.
See https://github.com/containers/podman/issues/21873

- Document the hardcoded dependency on `network-online.target` for images unit
and explain how it can be overriden if necessary.

- tests/e2e/quadlet: Add `assert-last-key-regex`

Required to test the `After=` override in [Unit] section
See https://github.com/containers/podman/pull/22057#issuecomment-2008959993

- quadlet/unitfile: add a prepenUnitLine method

Requirements on networks should be inserted at the top of the
section so the user can override them.

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
2024-05-22 13:46:42 +02:00
David Gibson d418391ce6 test, pasta: Ignore deprecated addresses in tests
The default_addr shell function in test/system/helpers.network is used to
get the host's default address, which is used in a number of pasta
networking tests.  However, in certain circumstances it can incorrectly
pick a deprecated address as the primary address.  Correct it to exclude
those.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-05-22 17:36:33 +10:00
renovate[bot] 08507f3ffe
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.18.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-22 02:14:25 +00:00
renovate[bot] 1766a1a24b
chore(deps): update dependency setuptools to v70
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-21 11:48:22 +00:00
openshift-merge-bot[bot] 8bb86586f8
Merge pull request #22740 from Luap99/rootlessnetns-hosts
fix incorrect host.containers.internal entry for rootless bridge mode
2024-05-20 12:35:22 +00:00
Paul Holzinger fb2ab832a7
fix incorrect host.containers.internal entry for rootless bridge mode
We have to exclude the ips in the rootless netns as they are not the
host. Now that fix only works if there are more than one ip one the
host available, if there is only one we do not set the entry at all
which I consider better as failing to resolve this name is a much better
error for users than connecting to a wrong ip. It also matches what
--network pasta already does.

The test is bit more compilcated as I would like, however it must deal
with both cases one ip, more than one so there is no way around it I
think.

Fixes #22653

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-17 12:28:44 +02:00
openshift-merge-bot[bot] cb658b061e
Merge pull request #22525 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.17.3
2024-05-17 09:31:47 +00:00
openshift-merge-bot[bot] f7a30461e0
Merge pull request #22658 from giuseppe/libpod-wait-for-healthy-on-main-thread
libpod: wait for healthy on main thread
2024-05-16 15:59:54 +00:00
openshift-merge-bot[bot] 31bfabf6af
Merge pull request #22715 from rhatdan/volumes1
Return StatusNotFound when multiple volumes matching occurs
2024-05-16 12:52:56 +00:00
Paul Holzinger 061bcc06ea
test: remove test_podman* scripts
They are not run in CI and to my knowledge are not used by anyone, we
have much more/better tests in test/e2e and test/system that should
cover everything done in these scripts so just delete them to not
confuse contributors.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-15 13:08:39 +02:00
Paul Holzinger cb905f59ea
test/system: fix documentation
First, point users to hack/bats for running them locally. Second, remove
TODO.md as it doesn't contain any helpful information. Basically all the
missing tests there have been added so this does not serve any purpose
and is missleading.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-15 13:08:39 +02:00
Daniel J Walsh 6408a05927
Return StatusNotFound when multiple volumes matching occurs
Fixes #22616

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-05-15 06:21:14 -04:00
Giuseppe Scrivano b06c58b4a5
libpod: wait for healthy on main thread
wait for the healthy status on the thread where the container lock is
held.  Otherwise, if it is performed from a go routine, a different
thread is used (since the runtime.LockOSThread() call doesn't have any
effect), causing pthread_mutex_unlock() to fail with EPERM.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-14 22:55:02 +02:00
Nalin Dahyabhai c46884aa93 `podman events`: check for an error after we finish reading events
The function that's handing us events will return an error after closing
the channel over which it's sending events, and its caller (in its own
goroutine) will then send that error over another channel.

The logic that started the goroutine is likely to notice that the events
channel is closed before noticing that the error channel has a result
for it to read, so any error that would have been communicated would be
lost.

When we finish reading events, check if the reader returned an error
before telling our caller that there was no error.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-05-14 13:18:51 -04:00
Paul Holzinger bcb7edfded
remote API: restore v4 payload in container inspect
The v5 API made a breaking change for podman inspect, this means that
an old client could not longer parse the result from the new 5.X server.
The other way around new client and old server already worked.

As it turned out there were several users that run into this, one case
to hit this is using an old 4.X podman machine wich now pulls a newer
coreos with podman 5.0. But there are also other users running into it.
In order to keep the API working we now have a version check and return
the old v4 compatible payload so the old remote client can still work
against a newer server thus removing any major breaking change for an
old client.

Fixes #22657

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-14 17:56:20 +02:00
openshift-merge-bot[bot] a6aa5c8fcf
Merge pull request #22673 from tnk4on/fix-farm-remote
Fix podman-remote support for `podman farm build`
2024-05-14 13:14:36 +00:00
openshift-merge-bot[bot] f568afec05
Merge pull request #22695 from Luap99/rootless-reexec
rootless: fix reexec to use /proc/self/exe
2024-05-14 12:16:53 +00:00
Paul Holzinger 2a609b0f74
rootless: fix reexec to use /proc/self/exe
Under some circumstances podman might be executed with a different argv0
than the actual path to the podman binary. This breaks the reexec logic
as it tried to exec argv0 which failed.

This is visible when using podmansh as login shell which get's the
special -podmansh on argv0 to signal the shell it is a login shell.

To fix this we can simply use /proc/self/exe as command path which is
much more robust and the argv array is still passed correctly.

Fixes #22672

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-14 12:02:19 +02:00
Ed Santiago d4e40fedaf ExitWithError() - enforce required exit status & stderr
Final followup to #22270. That PR added a temporary convention
allowing a new form of ExitWithError(), one with an exit code
and stderr substring. In order to allow bite-size progress,
the old no-args form was still allowed. This PR removes
support for no-args ExitWithError().

This PR also adds one piece of new functionality: passing ""
(empty string) as the stderr arg means "expect exit code
but fail if there's anything at all in stderr".

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 13:59:17 -06:00
Ed Santiago 82f9811a8d ExitWithError() - a few that I missed
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 13:59:17 -06:00
openshift-merge-bot[bot] c9808e7edf
Merge pull request #22533 from Luap99/e2e-tmp-ci
run e2e test on tmpfs
2024-05-13 18:21:28 +00:00
openshift-merge-bot[bot] abfd0228d9
Merge pull request #22398 from andremarianiello/graceful-kube-down
Graceful shutdown during podman kube down
2024-05-13 16:45:14 +00:00
openshift-merge-bot[bot] dfab103bd3
Merge pull request #22660 from edsantiago/exitwitherror-rmi
ExitWithError() - rmi_test
2024-05-13 15:52:59 +00:00
openshift-merge-bot[bot] 3049bc4533
Merge pull request #22661 from edsantiago/exitwitherror-r
ExitWithError() - more r files
2024-05-13 15:35:43 +00:00
openshift-merge-bot[bot] 7fa103f277
Merge pull request #22582 from edsantiago/exitwitherror-part6
ExitWithError() - s files
2024-05-13 15:32:49 +00:00
Paul Holzinger e771618531
run e2e test on tmpfs
Follow up to commit eaf60c7fe7, with the toolbox image removal it is
possible to run all tests from tmpfs.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-13 17:26:16 +02:00
Ed Santiago 755fc021f9 ExitWithError() - rmi_test
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles only one file, test/e2e/rmi_test.go , because
my changes are significant enough to merit individual review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 07:24:36 -06:00
Ed Santiago 5e240ab1f5 ExitWithError() - more r files
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles all remaining test/e2e/r*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 07:24:28 -06:00
Ed Santiago 0c22de7811 ExitWithError() - s files
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles test/e2e/s*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 07:24:06 -06:00
Ed Santiago 03f036b515 ExitWithError() - more run_xxx tests
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles a subset of test/e2e/run_xxx_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-13 07:23:58 -06:00
openshift-merge-bot[bot] 0c09421f85
Merge pull request #22641 from mheon/handle_stopping_loop
Ensure that containers do not get stuck in stopping
2024-05-13 12:32:40 +00:00
openshift-merge-bot[bot] 2e51803d41
Merge pull request #22638 from Luap99/vendor
update c/{buildah,common,image,storage} to latest main
2024-05-13 08:14:52 +00:00
Shion Tanaka 3b1c735b67 Fix podman-remote support for `podman farm build`
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2024-05-12 03:01:22 +09:00
Matt Heon 3fa8e98a31 Ensure that containers do not get stuck in stopping
The scenario for inducing this is as follows:
1. Start a container with a long stop timeout and a PID1 that
   ignores SIGTERM
2. Use `podman stop` to stop that container
3. Simultaneously, in another terminal, kill -9 `pidof podman`
   (the container is now in ContainerStateStopping)
4. Now kill that container's Conmon with SIGKILL.
5. No commands are able to move the container from Stopping to
   Stopped now.

The cause is a logic bug in our exit-file handling logic. Conmon
being dead without an exit file causes no change to the state.
Add handling for this case that tries to clean up, including
stopping the container if it still seems to be running.

Fixes #19629

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-05-09 11:17:24 -04:00
openshift-merge-bot[bot] 4a11f1eeb4
Merge pull request #22648 from edsantiago/exitwitherror-p
ExitWithError() - rest of the p files
2024-05-09 12:04:37 +00:00
openshift-merge-bot[bot] 63ab9275b7
Merge pull request #22601 from xkr47/feat/quadlet-group-add
Quadlet/Container: Add GroupAdd option
2024-05-09 08:49:19 +00:00
Ed Santiago 9e43e586c9 ExitWithError() - rest of the p files
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles all remaining test/e2e/p*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-08 15:57:47 -06:00
Andre Marianiello a2cf948f90
Graceful shutdown during podman kube down
Signed-off-by: Andre Marianiello <andremarianiello@users.noreply.github.com>
2024-05-08 14:24:12 -04:00
openshift-merge-bot[bot] 092d0402ad
Merge pull request #22346 from edsantiago/exitwitherror-part2
ExitWithError() - continue tightening
2024-05-08 17:43:39 +00:00
Paul Holzinger 521bbab864
test/system: fix broken "podman volume globs" test
This never tested what it said it did, the command line was wrong so
`,ro=false` was taken as image causing a error. What this actually
should care about is that a glob is taken as is and not evaluated.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-08 15:01:20 +02:00
Jonas Berlin 6d1098f823 Quadlet/Container: Add GroupAdd option
Co-authored-by: Ygal Blum <ygal.blum@gmail.com>
Signed-off-by: Jonas Berlin <xkr47@outerspace.dyndns.org>
2024-05-08 16:00:28 +03:00
openshift-merge-bot[bot] db44d57b86
Merge pull request #22591 from Luap99/remove-toolbox-image
test/e2e: remove toolbox image
2024-05-08 11:41:52 +00:00
Ed Santiago 641cd7c5a2 ExitWithError() - continue tightening
Followup to #22270 : wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

A small number of tests were broken, as in, not actually testing
what they claimed to be testing. I've done my best to fix those.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-07 18:57:43 -06:00
openshift-merge-bot[bot] b63a85c81d
Merge pull request #22627 from edsantiago/exitwitherror-part8
ExitWithError() - play_kube_test.go
2024-05-07 18:02:38 +00:00
openshift-merge-bot[bot] 1150020cb2
Merge pull request #22635 from giuseppe/fix-test-for-powercap
test: improve test for powercap presence
2024-05-07 17:59:52 +00:00
Giuseppe Scrivano 303d0b398e
test: improve test for powercap presence
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-05-07 17:24:50 +02:00
renovate[bot] 164aef814e
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.17.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-07 14:28:18 +00:00
renovate[bot] be5cbc443e
fix(deps): update module golang.org/x/tools to v0.21.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-07 12:53:01 +00:00
openshift-merge-bot[bot] 2e624d2acf
Merge pull request #22613 from edsantiago/exitwitherror-part7
ExitWithError() - v files
2024-05-07 09:33:49 +00:00
openshift-merge-bot[bot] f078258c83
Merge pull request #22560 from edsantiago/exitwitherror-part4
ExitWithError() -- run_test.go
2024-05-07 01:40:47 +00:00
Ed Santiago 7d12ae0973 ExitWithError() - play_kube_test.go
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles test/e2e/play_kube_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-06 15:59:53 -06:00
Ed Santiago 83ee16b9ba ExitWithError() - v files
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles test/e2e/v*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-06 08:42:48 -06:00
Paul Holzinger 7a43c2ed1b
test/e2e: remove toolbox image
The image is way to big (over 800MB) that slows tests down as we always
have to pull this, the tests itself are also super slow due the
entrypoint logic that we don't care about. We should be testing for
features needed and not specific tools.

I think the current changes should have a similar coverage in terms of
podman features, it no longer tests toolbox but IMO this never was a
task for podman CI tests.

The main driver for this is to make the tests run entirely based on
tmpfs and this image is just to much[1].

[1] https://github.com/containers/podman/pull/22533

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-03 16:45:51 +02:00
Dan Čermák 46f247d880
Also substitute $HOME in runlabel with user's homedir
Some programs have their configuration files relative to the user's
home. It would be convenient being able to mount these into the container, but
that requires expansion of `~` or `$HOME` in a label. This commit adds support
for that for the `runlabel` command.

Signed-off-by: Dan Čermák <dcermak@suse.com>
2024-05-03 14:00:20 +02:00
Ed Santiago 275c068df7 ExitWithError() - pod_xxx tests
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

This commit handles a subset of test/e2e/pod_xxxx_test.go
(I stopped before this grew too huge for review)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-02 08:48:24 -06:00
Ed Santiago c378f2d03a ExitWithError() -- run_test.go
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-05-01 07:41:10 -06:00
openshift-merge-bot[bot] 9b6a3a34ba
Merge pull request #22548 from edsantiago/tools-ginkgo-update
vendor ginkgo 2.17.2 into test/tools
2024-04-30 19:50:16 +00:00
openshift-merge-bot[bot] ce365db3a6
Merge pull request #22522 from containers/renovate/pytest-8.x
Update dependency pytest to v8.1.2
2024-04-30 18:40:53 +00:00
Ed Santiago 1bc6f16bd0 vendor ginkgo 2.17.2 into test/tools
..to match the version in root dir, to get rid of the mismatch
warning on every ginkgo run.

I still don't understand why renovatebot isn't doing this.

(Also, touch a file under e2e, to force tests to run)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-30 09:26:35 -06:00
Paul Holzinger 88b80c1df6
test/e2e: podman unshare image mount fix tmpdir leak
Because the test left the image mounted the cleanup failed to remove the
tmpdir as it contained an active mount point. Thus ensure we unmount the
image again to prevent this leak.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:37 +02:00
Paul Holzinger 0faded53b8
test/e2e: do not leak /tmp/private_file
This should use the proper per test tempdir which works just as well for
the purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:37 +02:00
Paul Holzinger 88a625d319
test/e2e: "persistentVolumeClaim with source" do not leak file
Using /tmp means this file will be leaked and no deleted, switch to
using the per test tempdir which is removed after the test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:36 +02:00
Ed Santiago eaf60c7fe7 e2e tests: use /var/tmp, not $TMPDIR, as workdirs
TMPDIR is typically /tmp which is typically(*) a tmpfs.

This PR ignores $TMPDIR when $CI is defined, forcing all
e2e tests to set up one central working directory in /var/tmp
instead.

Also, lots of cleanup.

 (*) For many years, up to and still including the time of
     this PR, /tmp on Fedora CI VMs is actually NOT tmpfs,
     it is just / (root). This is nonstandard and undesirable.
     Efforts are underway to remove this special case.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-26 14:29:56 -06:00
renovate[bot] 60b5488308
Update dependency pytest to v8.1.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 18:14:28 +00:00
Paul Holzinger 9a0ed6929a
test/e2e: force systemd cgroup manager
It is not clear why rootless was forced to the cgroupfs manager when
systemd is the default. In any case it causes local test failures as
described in the issue[1]. Using systemd manager makes them pass as
expected, I don't know enough aout cgroups to know the difference and
why certain tests have bad asumptions but this fixes it.

[1] https://github.com/containers/podman/issues/22474

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:37:31 +02:00
Paul Holzinger 537c21a49a
test/e2e: fix volumes and suid/dev/exec options
When the source dir is already mounted noexec, nodev or nosuid then a
rootless user cannot mount the dir into the container without these
options for obvious reasons.

So in order to run the test we must ensure the dir is mounted with these
options first, if they are simply skip as the test will fail otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:20 +02:00
Paul Holzinger 31034a1b6f
test/e2e: volumes and suid/dev/exec options works remote
--volume works fine with podman-remote you just need to know that the
path is server side.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:20 +02:00
Paul Holzinger cc6e999f2a
test/e2e: fix limits test
When you run locally with a higher oom_score_adj then the one used in
the test podman will print a warning and not set the oom lower then the
current value. Thus use 999 as value which should only cause problems
for users with oom_score_adj value of 1000 (max value) which seems
unlikely.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:19 +02:00
Matt Heon 30e2c923d6 Add the ability to automount images as volumes via play
Effectively, this is an ability to take an image already pulled
to the system, and automatically mount it into one or more
containers defined in Kubernetes YAML accepted by `podman play`.

Requirements:
- The image must already exist in storage.
- The image must have at least 1 volume directive.
- The path given by the volume directive will be mounted from the
  image into the container. For example, an image with a volume
  at `/test/test_dir` will have `/test/test_dir` in the image
  mounted to `/test/test_dir` in the container.
- Multiple images can be specified. If multiple images have a
  volume at a specific path, the last image specified trumps.
- The images are always mounted read-only.
- Images to mount are defined in the annotation
  "io.podman.annotations.kube.image.automount/$ctrname" as a
  semicolon-separated list. They are mounted into a single
  container in the pod, not the whole pod.

As we're using a nonstandard annotation, this is Podman only, any
Kubernetes install will just ignore this.

Underneath, this compiles down to an image volume
(`podman run --mount type=image,...`) with subpaths to specify
what bits we want to mount into the container.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 14:12:27 -04:00
Matt Heon 693ae0ebc6 Add support for image volume subpaths
Image volumes (the `--mount type=image,...` kind, not the
`podman volume create --driver image ...` kind - it's strange
that we have two) are needed for our automount scheme, but the
request is that we mount only specific subpaths from the image
into the container. To do that, we need image volume subpath
support. Not that difficult code-wise, mostly just plumbing.

Also, add support to the CLI; not strictly necessary, but it
doesn't hurt anything and will make testing easier.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 14:12:27 -04:00
openshift-merge-bot[bot] 273020160c
Merge pull request #22504 from mheon/bump_buildah_fix_ci
Bump buildah to fix CI
2024-04-25 18:06:20 +00:00
Matt Heon 5f57571d65 Bump Buildah to latest main
Includes fixes from Ed's treadmill script.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 12:17:43 -04:00
Ed Santiago e4c9910aec ExitWithError() - yet more low-hanging fruit
Followup to [1]#22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

Just trying to shrink down #22346 to a manageable, reviewable size.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 09:04:50 -06:00
openshift-merge-bot[bot] 1a23451067
Merge pull request #22486 from edsantiago/exitwitherror-morelowhangingfruit
ExitWithError() - more low-hanging fruit
2024-04-24 14:58:22 +00:00
openshift-merge-bot[bot] a7c61c31a3
Merge pull request #22465 from Luap99/go1.21
Update to go 1.21
2024-04-24 14:30:59 +00:00
Ed Santiago 80c3a22440 ExitWithError() - more low-hanging fruit
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

More low-hanging fruit: small reviewable chunks

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 07:11:40 -06:00
Ed Santiago 4da5c5d3aa ExitWithError() - low-hanging fruit
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

Because #22346 is stalled, these are some trivial easy-to-review
changes that get us closer to the goal.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 05:44:40 -06:00
Paul Holzinger 83dbbc3a51
Replace golang.org/x/exp/slices with slices from std
Use "slices" from the standard library, this package was added in go
1.21 so we can use it now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-23 11:16:40 +02:00
openshift-merge-bot[bot] 318437f7b5
Merge pull request #22455 from edsantiago/e2e-stop-littering
e2e tests: stop littering
2024-04-22 14:31:09 +00:00
openshift-merge-bot[bot] 6d347927a6
Merge pull request #22443 from Luap99/podman-healthcheck-events
add containers.conf healthcheck_events support
2024-04-22 13:49:52 +00:00
Ed Santiago ac04cb4ac5 e2e tests: stop littering
"tmpdir + string" does not do what you think it does.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-22 06:43:19 -06:00
openshift-merge-bot[bot] c2cadfb5c5
Merge pull request #22322 from mheon/update_the_config
Make `podman update` changes persistent
2024-04-22 07:50:48 +00:00
Paul Holzinger 2ae6d0d4dd
add containers.conf healthcheck_events support
When the field is set to false we should never log healthcheck events.

Fixes https://issues.redhat.com/browse/RHEL-18987

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-19 17:29:48 +02:00
Giuseppe Scrivano 1991990d5a
pkg/specgen: use fileutils.(Le|E)xists
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-19 09:52:14 +02:00
Giuseppe Scrivano 598fc516a6
vendor: update containers/{buildah,common,image,storage}
The change in healthcheck_run_test.go, depends on the
containers/image change:

commit b6afa8ca7b324aca8fd5a7b5b206fc05c0c04874
Author: Mikhail Sokolov <msokolov@evolution.com>
Date:   Fri Mar 15 13:37:44 2024 +0200

    Add support for Docker HealthConfig.StartInterval (v25.0.0+)

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-19 09:52:13 +02:00
Paul Holzinger b1736c472a
test/compose: remove compose v1 code
Now that we only test compose v2 remove the special cases from the test
code to simply the tests.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-18 14:48:37 +02:00
Evgeni Golov 7b3456b5d9 add `list` as an alias to list networks
this makes it consistent with other commands,
but also makes the example actually work

Signed-off-by: Evgeni Golov <evgeni@golov.de>
2024-04-17 17:10:22 +02:00
Matt Heon 482ef7bfcf Add support for updating restart policy
This is something Docker does, and we did not do until now. Most
difficult/annoying part was the REST API, where I did not really
want to modify the struct being sent, so I made the new restart
policy parameters query parameters instead.

Testing was also a bit annoying, because testing restart policy
always is.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-17 08:23:51 -04:00
Matt Heon ddea30e40e Add Compat API for Update
The Docker endpoint here is kind of a nightmare - accepts a full
Resources block, including a large number of scary things like
devices. But it only documents (and seems to use) a small subset
of those. This implements support for that subset. We can always
extend things to implement more later if we have a need.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-17 08:23:51 -04:00
Matt Heon be3f075402 Make `podman update` changes persistent
The logic here is more complex than I would like, largely due to
the behavior of `podman inspect` for running containers. When a
container is running, `podman inspect` will source as much as
possible from the OCI spec used to run that container, to grab
up-to-date information on things like devices. We don't want to
change this, it's definitely the right behavior, but it does make
updating a running container inconvenient: we have to rewrite the
OCI spec as part of the update to make sure that `podman inspect`
will read the correct resource limits.

Also, make update emit events. Docker does it, we should as well.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-17 08:23:50 -04:00
Ed Santiago 7ef0290a1d Emergency fix (well, skip) for failing bud tests
nixery registry has been down all day. Disable test.

Someone will need to fix this on the buildah end.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-16 17:21:04 -06:00
renovate[bot] 3dc69a01e3
chore(deps): update module golang.org/x/crypto to v0.17.0 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-15 17:41:53 +00:00
openshift-merge-bot[bot] 2364b90736
Merge pull request #22357 from Luap99/swagger
fix api swagger docs
2024-04-15 17:40:39 +00:00
renovate[bot] 0e291ce760
chore(deps): update dependency setuptools to ~=69.5.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-13 17:31:33 +00:00
Paul Holzinger 5e9725983d
install swagger from source
First of all this removes the need for a network connection, second
renovate can update the version as it is tracked in go.mod.

However the real important part is that the binary downloads are
broken[1]. For some reason the swagger created with them does not
include all the type information for the examples. However when building
from source the same thing works fine.

[1] https://github.com/go-swagger/go-swagger/issues/2842

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-12 15:26:34 +02:00
openshift-merge-bot[bot] b8a684b64d
Merge pull request #22347 from rhatdan/exec
podman exec CID without command should exit 125
2024-04-12 12:51:35 +00:00
Daniel J Walsh 5e68fbd132
podman exec CID without command should exit 125
Fixes: https://github.com/containers/podman/issues/22329

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-04-12 07:44:22 -04:00
openshift-merge-bot[bot] e1ec17a569
Merge pull request #22352 from edsantiago/systest-prefetch
(minor) prefetch systemd image before use
2024-04-12 10:52:54 +00:00
openshift-merge-bot[bot] 4b2c7f272e
Merge pull request #22319 from Luap99/exposed-ports-ps
podman ps: show exposed ports under PORTS as well
2024-04-12 10:11:43 +00:00
Ed Santiago df69b36ee5 (minor) prefetch systemd image before use
Two system tests were relying on $SYSTEMD_IMAGE but were not
running _prefetch. This led to baffling flakes that wasted
my time. (Quay flakes, of course. New manifestation.)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-11 13:48:27 -06:00
openshift-merge-bot[bot] d65f3996dd
Merge pull request #21889 from containers/renovate/pytest-8.x
chore(deps): update dependency pytest to v8
2024-04-11 15:09:50 +00:00
openshift-merge-bot[bot] 8a7c3ea2f5
Merge pull request #22266 from baude/run2077
Add os, arch, and ismanifest to libpod image list
2024-04-11 15:01:32 +00:00
Brent Baude 08a49389c8 Add os, arch, and ismanifest to libpod image list
when listing images through the restful service, consumers want to know
if the image they are listing is a manifest or not because the libpod
endpoint returns both images and manifest lists.

in addition, we now add `arch` and `os` as fields in the libpod endpoint
for image listing as well.

Fixes: #22184
Fixes: #22185

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-04-11 08:46:37 -05:00
Ed Santiago 67c6d7ec80 vendor ginkgo 2.17.1 into test/tools
...to match the version in root dir, to get rid of the mismatch
warning on every ginkgo run.

The last bump was done by renovatebot; I don't know why bot didn't
do it this time.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-10 15:18:42 -06:00
Paul Holzinger 999d6c0750
fix "concurrent map writes" in network ls compat endpoint
Not sure why this only triggers now but this code was broken for a
while. It is racy as reported on the issue but because it changes the
actual map part of the network backend it means it can also alter the
behavior of the network which is very bad.

Fixes #22330

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-10 18:41:20 +02:00
renovate[bot] 26f866b5df
chore(deps): update dependency pytest to v8
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-10 12:39:09 +00:00
Ed Santiago 2d9159821a e2e: redefine ExitWithError() to require exit code
...and an optional error-message string, to be checked
against stderr.

This is a starting point and baby-steps progress toward #18188.
There are 249 ExitWithError() checks in test/e2e. It will take
weeks to fix them all. This commit enables new functionality:

    Expect(ExitWithError(125, "expected substring"))

...while also allowing the current empty-args form. Once
all 249 empty-args uses are modernized, the matcher code
will be cleaned up.

I expect it will take several months of light effort to get
all e2e tests transitioned to the new form. I am choosing to
do so in pieces, for (relative) ease of review. This PR:

  1) makes the initial changes described above; and
  2) updates a small subset of e2e _test.go files such that:
     a) ExitWithError() is given an exit code and error string; and
     b) Exit(Nonzero) is changed to ExitWithError(Nonzero, "string")
        (when possible)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-10 06:35:52 -06:00
Paul Holzinger 0bedf7f1d2
podman ps: show exposed ports under PORTS as well
Docker shows exposed ports as just PORT/PROTO so match that behavior. It
is not clear to me why someone needs that information in ps as "expose"
doesn't effect anything networking related.

Fixes https://issues.redhat.com/browse/RHEL-32154

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-10 14:24:23 +02:00
openshift-merge-bot[bot] 9fc46dfb67
Merge pull request #22314 from edsantiago/blow-a-fuse
e2e tests: remove requirement for fuse-overlayfs
2024-04-09 19:33:40 +00:00
renovate[bot] 266801bf2d
fix(deps): update module golang.org/x/tools to v0.20.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-09 11:42:31 +00:00
Ed Santiago 847ca1f9ea e2e tests: remove requirement for fuse-overlayfs
As of April 2024, it's no longer included in rawhide by default.
We could force-install it, but it's 2024 and it seems likely
that all systems on which Podman 5 will run will have kernels
that support native overlay.

I also added two debugging printfs to the 'podman info' test
that initially failed on an (unpublished) rawhide VM. Without
these printfs it was impossible to diagnose the failure.

Updating docs is left as a future exercise.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-09 05:25:20 -06:00
openshift-merge-bot[bot] 447d3e2a44
Merge pull request #22277 from Luap99/runroot
podman --runroot: remove 50 char length restriction
2024-04-06 11:12:07 +00:00
openshift-merge-bot[bot] 19600fa5e3
Merge pull request #22265 from containers/renovate/requests-mock-1.x
Update dependency requests-mock to ~=1.12.1
2024-04-05 16:27:27 +00:00
Paul Holzinger fcf9327773
podman --runroot: remove 50 char length restriction
This was added ages ago in commit c65b3599cc, however in the meantime
both podman and conmon can support longer socket paths as they use a
workaround to open the path via /proc/self/fd, see openUnixSocket() in
libpod/oci_conmon_attach_linux.go

Thus this restriction is not needed anymore and we can drop a workaround
in the tests.

Fixes #22272

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-05 14:41:50 +02:00
renovate[bot] beb4fd1b4a
Update dependency requests-mock to ~=1.12.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-04 18:37:25 +00:00
Paul Holzinger f2c365c6f6
rm --force work for more than one arg
When we remove with --force we do not return a error if the input does
not exists, however if we get more than on input we must try to remove
all and not just NOP out and not remove anything just because one arg
did not exists.

Also make the code simpler for commands that do have the --ignore option
and just make --force imply --ignore which reduces the ugly error
handling.

Fixes #21529

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-04 17:47:28 +02:00
openshift-merge-bot[bot] 8ab4bc9250
Merge pull request #22243 from Luap99/rootless-netns
vendor latest c/common to fix rootless-netns issues
2024-04-04 11:40:35 +00:00
openshift-merge-bot[bot] 0106e5929d
Merge pull request #22245 from giuseppe/do-not-chown-again-with-U
container: do not chown to dest target with U
2024-04-03 15:33:34 +00:00
openshift-merge-bot[bot] 6b9b85e011
Merge pull request #22175 from edsantiago/skip_if_no_slirp
systests: conditionalize slirp4netns tests
2024-04-03 13:32:19 +00:00
Paul Holzinger a61ae8c0a9
test/system: add rootless-netns test for setup errors
This is a test for #22168.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-03 15:01:51 +02:00
Giuseppe Scrivano 519a66c6a9
container: do not chown to dest target with U
if the 'U' option is provided, do not chown the destination target to
the existing target in the image.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-03 14:41:33 +02:00
Ed Santiago d27313ad10 systests: conditionalize slirp4netns tests
As of podman 5.0, slirp4netns is a soft dependency. It might
not be installed on a host (and, in gating tests, is not).
Deal with it.

Use podman itself, not 'which', to tell us if slirp4netns
is available. We don't want to duplicate podman's path-check
logic. Since this check is expensive, cache the result.

(Change the has_pasta check similarly)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-03 05:49:21 -06:00
Ed Santiago e697631af9 CI: systests: instrument flaky tests
Three infrequent flakes. Add debug code to help track
down if/when they happen again.

And, one of them, fix a logic bug that will save us 8-10s
on system tests runs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-03 05:26:51 -06:00
Giuseppe Scrivano 7d68362cf5
test: do not skip tests under rootless
there are no overlay mounts in the "podman run with --volume and U
flag" tests so no need to skip them.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-04-03 11:02:16 +02:00
openshift-merge-bot[bot] e1f49529fa
Merge pull request #22229 from giuseppe/fix-idmap-existing-volume
libpod: use original IDs if idmap is provided
2024-04-01 19:08:29 +00:00
Giuseppe Scrivano d81319eb71
libpod: use original IDs if idmap is provided
if the volume is mounted with "idmap", there should not be any mapping
using the user namespace mappings since this is done at runtime using
the "idmap" kernel feature.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-03-31 23:46:17 +02:00
Ed Santiago aab4674feb CI: Bump VMs to 2024-03-28
Emergency update to get pasta 03-26. Also gives us crun 1.14.4.

One unexplained difference: fc39 and rawhide now create:

    /run/log/journal/SOMETHING/system.journal

...and the SOMETHING is o-rwx. This triggers journalctl to spit out a warning:

    Hint: You are currently not seeing messages from the system.
          Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.
          Pass -q to turn off this notice.

...which in turn causes ExitCleanly() to fail.

It is not clear who/what is creating this journal directory, or
why it allofasudden started just now. Workaround is to add -q
to journalctl in one test.

One more difference, another test now requires SYSLOG capability.

VM package info:
    https://github.com/containers/automation_images/pull/342

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-03-28 08:35:29 -06:00
openshift-merge-bot[bot] a1a5bd3bd5
Merge pull request #21493 from mporrato/fix-21211
kube play: always pull when both imagePullPolicy and tag are missing
2024-03-27 21:58:45 +00:00
openshift-merge-bot[bot] 25ebf10967
Merge pull request #22177 from mheon/fix_22172
Add rootless network command to `podman info`
2024-03-26 17:15:53 +00:00
Matt Heon b56331cd2f Add rootless network command to `podman info`
Useful to tell whether containers are being made with pasta or
slirp4netns by default. Info is bloated enough already that I
don't really have concerns about shoving more into it.

Fixes #22172

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-03-26 09:56:48 -04:00
diplane 83fe867c14 Add support for annotations
Fix following issues:
- create container API handler ignores Annotations from HostConfig
- inspect container API handler does not provide Annotations as
  part of HostConfig

Signed-off-by: diplane <diplane3d@gmail.com>
2024-03-22 19:38:22 +00:00
openshift-merge-bot[bot] 3a327fa16e
Merge pull request #22096 from containers/renovate/github.com-cpuguy83-go-md2man-v2-2.x
Update module github.com/cpuguy83/go-md2man/v2 to v2.0.4
2024-03-20 15:54:11 +00:00
openshift-merge-bot[bot] 5bcafe7ae0
Merge pull request #22019 from saschagrunert/cri-o-annotations
Remove CRI-O related annotations
2024-03-20 15:51:29 +00:00
openshift-merge-bot[bot] d5a2c4166e
Merge pull request #22089 from edsantiago/minikube-debug
minikube: instrument tests, to allow debugging failures
2024-03-20 15:40:26 +00:00
renovate[bot] a872003a2a
Update module github.com/cpuguy83/go-md2man/v2 to v2.0.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-20 11:43:15 +00:00
Ed Santiago aa5c4879b4 minikube: instrument tests, to allow debugging failures
New run_minikube() helper, modeled after run_podman(). Echoes
each command being run and its output. On failure, runs minikube logs.

Addresses (does not close) #21931 which is hitting us hard in CI.
Probably quay flakes, but it's impossible to tell without logs.

Also: bug fix: one "run podman" fixed to run_podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-03-19 11:11:44 -06:00
Paul Holzinger dc1795b4b2
use new c/common pasta2 setup logic to fix dns
By default we just ignored any localhost reolvers, this is problematic
for anyone with more complicated dns setups, i.e. split dns with
systemd-reolved. To address this we now make use of the build in dns
proxy in pasta. As such we need to set the default nameserver ip now.

A second change is the option to exclude certain ips when generating the
host.containers.internal ip. With that we no longer set it to the same
ip as is used in the netns. The fix is not perfect as it could mean on a
system with a single ip we no longer add the entry, however given the
previous entry was incorrect anyway this seems like the better behavior.

Fixes #22044

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-19 12:09:31 +01:00
Stefano Brivio 23433ec7bd test/system: Add support for multipath routes in pasta networking tests
In some environments, such as the one described in
https://github.com/containers/podman/issues/20927, the default route
is given as nexthop gateways. That is, it's a multipath routes with
multiple gateways.

That means that pasta(1), after commit 6c7623d07bbd ("netlink: Add
support to fetch default gateway from multipath routes"), can start
and use a default gateway from that route.

Just like in pasta(1), in these tests, the default route indicates
which upstream interface we should pick. If we ignore multipath
routes, IPv6 addresses and gateway addresses themselves won't be
available, so, while pasta is now able to configure the container,
IPv6 tests will expect to find no address and no gateway, hence fail
due to the mismatch.

Try to get routes, including gateway addresses and interface names,
from nexthop objects, in case the selection of a regular default
route yields no results.

Link: https://github.com/containers/podman/issues/20927
Closes: #20927
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2024-03-18 14:29:38 +01:00
openshift-merge-bot[bot] f5abca415d
Merge pull request #21979 from chilikk/fix-exec-headers
fix invalid HTTP header values when hijacking a connection
2024-03-14 19:38:46 +00:00
renovate[bot] d5e0ecc619
Update dependency setuptools to ~=69.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-14 02:36:50 +00:00
Denys Knertser 2ff5716b7e fix invalid HTTP header values when hijacking a connection
Signed-off-by: Denys Knertser <denys@avassa.io>
2024-03-12 23:05:25 +01:00
Sascha Grunert 1901403eda
Removing CRI-O related annotations
The annotations should be maintained by CRI-O itself to decouple the
projects from a dependency perspective.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-03-12 14:56:06 +01:00
openshift-merge-bot[bot] 35a8b03267
Merge pull request #21949 from edsantiago/more-flake-fixes
CI: try to fix more flakes
2024-03-06 14:04:06 +00:00
openshift-merge-bot[bot] 9c73326e12
Merge pull request #21948 from edsantiago/fix-checkpoint-race
e2e: fix potential race in file-locks test
2024-03-05 21:10:56 +00:00
Ed Santiago 39851a0b98 CI: try to fix more flakes
Most of them look like our usual "assume too much about run -d".

One of them is just an unexpected warning, a push retry. Remove
the ExitCleanly() from that test, just rely on Exit(0).

The other two have to do with podman logs, which we know can lag.
Add a short 1-second retry loop.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-03-05 12:15:22 -07:00
Ed Santiago 945995be10 e2e: fix potential race in file-locks test
Two test flakes in the past week. Looks like the usual race
between "run -d" and "assume the container is ready". I don't
know if this will resolve them, but it's still a good idea.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-03-05 07:55:06 -07:00
Paul Holzinger 9ee96a9569
properly implement pull-error event status
Commit 03f6589f3 added basic support for pull-error event from libimage
but it contains several problems:
1. storing the error as error type prevents it from being unmarshalled,
   thus change it to a string
2. the error was never propagated from the libimage event to the podman
   event struct
3. the error message was not wired into the cli and API

This commit fixes these problems.

Fixes #21458

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-05 10:50:42 +01:00
renovate[bot] 155cd463da
fix(deps): update module golang.org/x/tools to v0.19.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 06:58:51 +00:00
Paul Holzinger ebce0e71da
test/e2e: check for stderr errors in cleanup()
There are many code paths which only do logrus but still exit 0 so this
should catch more bugs. Unfortunately runc logs way to much random stuff
so we ignore this check for runc right now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-04 11:25:22 +01:00
openshift-merge-bot[bot] 0ace66f1ae
Merge pull request #21904 from containers/renovate/python-dateutil-2.x
chore(deps): update dependency python-dateutil to ~=2.9.0
2024-03-01 18:15:34 +00:00
Brent Baude 0898b338b0 Use stop timeout of zero for system reset
when performing a system reset with containers that run somewhere where
a soft kill wont work (like sleep), containers will wait 10 seconds
before terminating with a sigkill.  But for a forceful action like
system reset, we should outright set no timeout so containers stop
quickly and are not waiting on a timeout

Fixes #21874

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-03-01 10:51:58 -06:00
renovate[bot] 542883b9ba
chore(deps): update dependency python-dateutil to ~=2.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-01 14:45:10 +00:00
Daniel J Walsh 3abc488c84
Vendor in containers/(buildah, common)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-29 20:06:28 -05:00
openshift-merge-bot[bot] 38546de7b6
Merge pull request #21892 from rhatdan/codespell
[SKIP-ci] Run codespell on code
2024-03-01 00:34:01 +00:00
openshift-merge-bot[bot] b736c461bb
Merge pull request #21563 from mheon/test_pasta_default
Vendor c/common pasta branch for testing
2024-02-29 22:13:47 +00:00
Daniel J Walsh 4a03da22ad
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-29 16:55:31 -05:00
openshift-merge-bot[bot] 1519c04212
Merge pull request #21886 from containers/renovate/pytest-7.x
Update dependency pytest to v7.4.4
2024-02-29 20:45:48 +00:00
openshift-merge-bot[bot] b681209efe
Merge pull request #21653 from nalind/fun-with-artifacts
podman manifest add: support creating artifact manifest on the fly
2024-02-29 19:04:03 +00:00
renovate[bot] 52fd284fd4
Update dependency pytest to v7.4.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-29 18:42:48 +00:00
openshift-merge-bot[bot] 98a9aee2d2
Merge pull request #21601 from flobz/feature/docker_v1.44_compat
Make inspect compatible with docker v1.44 API
2024-02-29 18:42:01 +00:00
openshift-merge-bot[bot] 41fa1c2c5c
Merge pull request #21878 from giuseppe/fix-manifest-test-assumption
test: fix manifest e2e test assumption
2024-02-29 18:22:45 +00:00
Matt Heon 4c1c4c082a Vendor latest c/common and fix tests
This vendors the latest c/common version, including making Pasta
the default rootless network provider. That broke a number of
tests, which have been fixed as part of this PR.

Also includes a change to network stats logic, which simplifies
the code a bit and makes it actually work with Pasta.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-29 12:16:51 -05:00
Giuseppe Scrivano c50826cea9
test: fix manifest e2e test assumption
fix an assumption in the test, that the --compression-format is
unchanged from the original image.

Instead validate that all the required architectures are part of the
manifest.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-29 18:13:37 +01:00
Nalin Dahyabhai f168b3c115 podman manifest add: support creating artifact manifest on the fly
Add a --artifact flag to `podman manifest add` which can be used to
create an artifact manifest for one or more files and attach it to a
manifest list.  Corresponding --artifact-type, --artifact-config-type,
--artifact-config, --artifact-layer-type, --artifact-subject, and
--artifact-exclude-titles options can be used to fine-tune the fields in
the artifact manifest that don't refer to the files themselves.

Add a --index option to `podman manifest annotate` that will cause
values passed to the --annotation flag to be applied to the manifest
list as a whole instead of to an entry in the list.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-02-29 11:47:44 -05:00
Daniel J Walsh 66d60384f4
add --retry --retry-delay to podman run/create
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-29 10:20:21 -05:00
Daniel J Walsh c3c0c4ab96
Add support for podman push --retry --retry-delay
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-29 10:20:21 -05:00
openshift-merge-bot[bot] 98d1ad5a22
Merge pull request #21875 from Luap99/mount-test
test/system: fix mount external container test
2024-02-29 14:58:09 +00:00
Paul Holzinger 99b2f369db
test/system: fix mount external container test
Checking for the mountdir is not relevent, a recent c/storage change[1] no
longer deletes the mount point directory so the check will cause a false
positive. findmnt exits 1 when the given path is not a mountpoint so
let's use that to check.

[1] 3f2e81abb3

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-29 13:48:26 +01:00
openshift-merge-bot[bot] 690b671ecd
Merge pull request #20774 from giuseppe/passthrough-tty
logging: new mode -l passthrough-tty
2024-02-29 12:43:36 +00:00
openshift-merge-bot[bot] c1ac602d39
Merge pull request #21868 from edsantiago/reenable-boltdb-upgrade-test
Reenable boltdb upgrade tests
2024-02-29 09:47:35 +00:00
Ed Santiago 064258b496 Reenable boltdb upgrade tests
Upgrade-from-v4.1 was temporarily disabled in #21618: we brought
in new CI VMs, and v4.1 setup no longer works. Nobody quite
understands why, and we've hit diminishing returns in the
investigation (#21863). The current thinking is that it
is related to netavark, and versions < 1.3 do not work
in the current f39 VMs. (No clue why, because f39 kernel
did not change in #21618).

Anyhow, reenable the pre-4.8 upgrade test, using v4.3.1
which has netavark-1.4.0 which seems to work fine. For now.

Also, some upgrade test cleanup:
 - Skip, not fail, if initial setup fails. Makes for less noisy logs.
 - Remove duplicate --pid=host
 - Ports: 808x -> 909x, because 8081 is used by restraint on 1mt

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-28 11:49:54 -07:00
Florian Bezannier 1de94dceb5 ci: fix module not found
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
2024-02-28 19:45:03 +01:00
Florian Bezannier facad62afe tests: fix after make podman inspect cmd return compatible with Docker API v1.44
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
2024-02-28 19:45:03 +01:00
Florian Bezannier 2cd72c272f tests: add docker api compatibility test
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
2024-02-28 19:45:03 +01:00