Commit Graph

6094 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] d1d38b2aa4
Merge pull request #21011 from edsantiago/wait_wait_wait
CI: safer podman-stop tests
2023-12-15 20:31:38 +00:00
Gavin Lam db68764d8b
Fix Docker API compatibility with network alias (#17167)
* Add BaseHostsFile to container configuration
* Do not copy /etc/hosts file from host when creating a container using Docker API

Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2023-12-14 23:31:44 -05:00
Ygal Blum d026ccf9a7 Kube Play - pass arguments to build
Create a buildah SystemContext from the existing cli arguments
Pass the SystemContext to the build
Add system test

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-14 16:31:09 +02:00
Ed Santiago 1c59a9ced1 CI: safer podman-stop tests
A number of tests start a container then immediately run podman stop.
This frequently flakes with:

   StopSignal SIGTERM failed to stop [...] in 10 seconds, resorting to SIGKILL

Likely reason: container is still initializing, and its process
has not yet set up its signal handlers.

Solution: if possible (containers running "top"), wait for "Mem:"
to indicate that top is running. If not possible (pods / catatonit),
sleep half a second.

Intended to fix some of the flakes cataloged in #20196 but I'm
leaving that open in case we see more. These are hard to identify
just by looking in the code.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-14 04:49:46 -07:00
openshift-merge-bot[bot] b82e336751
Merge pull request #21004 from umohnani8/push-endpoint
Fix push endpoint stream
2023-12-13 22:41:33 +00:00
Urvashi Mohnani 126670d5dd Fix push endpoint stream
The push binding endpoint wasn't actually writing the
output data to the stream when quiet=false and there
was no push error.
Do not hard code quiet=true anymore, take into account the
user input.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-12-13 13:01:21 -05:00
Ed Santiago 232c32bd35 CI: systests: safer isolation in registry & tests
Our test registry (used for login & local registry tests)
was being run using the standard podman tmpdir, hence the
standard podman database, This was then getting clobbered
in the 330-corrupt-images test, which runs "system reset".
We just didn't know this was happening. Until we added
a registry test after the system reset. Oops.

Solution: new helper function podman_isolation_opts()
sets --root, --runroot, *and --tmpdir*. Refactor all
existing --root/--runroot usages. Document.

Next problem: the "network reload" test in 500-networking.bats
did not (could not) know about our registry port, so the
"iptables -F" command reverted that to DROP, so the subsequent
podman-auth in 700-play timed out.

Solution: add a podman-isolated "network reload" to start_registry().

Final problem, because, really, those weren't enough: a BATS
bug where running with --filter-tags would set IFS=',' in setup_suite
which in turn has catastrophic consequences:

    https://github.com/bats-core/bats-core/issues/812

See #20966 for details of the failure and further conversation.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-13 09:46:09 -07:00
openshift-merge-bot[bot] 4582b61d7c
Merge pull request #20958 from rhatdan/ps
Support podman ps --format '{{ .Label label }}'
2023-12-13 14:26:17 +00:00
openshift-merge-bot[bot] 5db4224427
Merge pull request #20976 from Luap99/string-array
cli: use StringArray over StringSlice Part 2
2023-12-13 12:22:31 +00:00
Daniel J Walsh f51ff77644
Support podman ps --format '{{ .Label label }}'
Also Support for podman pod ps  --format '{{ .Label label }}'

Finally fix support for --format '{{ .Podname }}'
   When user specifies .Podname this implies --pod was passed.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-12-13 07:09:54 -05:00
openshift-merge-bot[bot] a5c8bb25cc
Merge pull request #20997 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.16.1
2023-12-13 11:02:43 +00:00
openshift-merge-bot[bot] a52f75e20b
Merge pull request #20938 from edsantiago/new_vms
CI: unskip tests on new VMs
2023-12-13 10:32:30 +00:00
renovate[bot] 36e04599af
fix(deps): update module golang.org/x/tools to v0.16.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 22:06:35 +00:00
Paul Holzinger 0f02e43cee
cli: podman manifest annotate --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
Paul Holzinger d8c3e5b3c1
cli: podman manifest add --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
Paul Holzinger 3e10a68328
cli: podman kube play --configmap use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
Paul Holzinger 2be4b007b0
cli: podman kube play --log-opt use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
Paul Holzinger 48ab4aec31
podman kube play: fix broken annotation parsing
If a user did not set an equal sign in the annotation that old code
would panic when accessing the second element in the slice.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:21 +01:00
Paul Holzinger e916f49f0b
cli: podman kube play --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
Paul Holzinger cdb178e954
cli: podman push --encryption-key use StringArray()
This option accepts a file path so we should allow commas in it.
Also add tests for --decryption-key

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-11 15:43:20 +01:00
Ed Santiago 6415471dcd EMERGENCY: fix broken CI
Broken by #20827.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-11 06:28:21 -07:00
openshift-merge-bot[bot] 611ba2ff31
Merge pull request #20827 from kaivol/userns-auto-intermediate-id-lookup
Support lookup of intermediate ID for uidmapping and gidmapping in `--userns=auto`
2023-12-11 10:19:14 +00:00
kaivol 952c708906 added system test
Signed-off-by: kaivol <github@kavol.de>
2023-12-10 14:16:08 +01:00
Karuboniru 23f6c48515 Add test for relative idmap mount
Signed-off-by: Karuboniru <yanqiyu01@gmail.com>
2023-12-10 13:13:30 +00:00
Ed Santiago c823d49fdc CI: unskip tests
New VMs have netavark 1.9, which fixes the "cannot talk to syslog"
warning when running containerized, so we can reenable clean-output
checks in containerized e2e tests

pasta: some new VMs have passt >= 2023-11-10, but f38 does not,
and f39 is unclear (my version extractor could not tell). So
I'm leaving the 20170 skip.

Debian runc now supports umask in *run*, but not *exec*. Even
with runc 1.1.10. And we don't even know what the situation is
on RHEL... so, run the podman-run umask tests but not exec.

Fixes: #19809

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-08 15:51:36 -07:00
Paul Holzinger 4590b663a7
add test for podman exec --env-file
There was no test for this option, resuse existing podman run
--env-file test for exec as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:24 +01:00
Paul Holzinger 833163ff3e
add podman create --label-file test
There was no test for this option so I added one.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 15:06:23 +01:00
Paul Holzinger 201920f6a4
cli: podman run/create --chrootdirs use StringArray()
This options accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:02 +01:00
Paul Holzinger dbbec99361
cli: podman run/create --log-opt use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Fixes #20064

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
Paul Holzinger b011aa4430
cli: podman run/create --env-file use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
Paul Holzinger ef10073b51
cli: podman run/create --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
Paul Holzinger c5258d4630
cli: podman --hooks-dir use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
Paul Holzinger 12c39ffda2
cli: podman --module use StringArray()
This option accepts a file path so we should allow commas in it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-08 12:17:01 +01:00
Ed Santiago 0d1b90d367 CI: systests: fix flaking --since test
Very rare flake, probably caused by my nemesis, podman run -d

Solution: keep the sleep-1 (vs using nanosecond resolution),
but make sure we first wait for the output from the container.

Also, bump down the iteration delay in wait_for_output, from 5s to 1.
Thanks to Paul for noticing that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-07 09:41:07 -07:00
openshift-merge-bot[bot] a64cc98179
Merge pull request #20912 from edsantiago/fix_some_cp_flakes
systests: cp: add wait_for_ready
2023-12-06 15:38:37 +00:00
openshift-merge-bot[bot] 72ceb6ee82
Merge pull request #20905 from Odilhao/issue-20585-entrypoint
Add support for Entrypoint in quadlet
2023-12-06 14:13:03 +00:00
openshift-merge-bot[bot] 67aae8e62e
Merge pull request #20866 from giuseppe/add-preserve-fds-list
podman: new option --preserve-fd
2023-12-06 13:34:34 +00:00
openshift-merge-bot[bot] 6efebb35cb
Merge pull request #20889 from ygalblum/quadlet-build-crash
Kube Play - set ReportWriter when building an image
2023-12-05 19:55:35 +00:00
Ed Santiago 4d2125bafb systests: cp: add wait_for_ready
Some of the tests were doing "podman run -d" without wait_for_ready.
This may be the cause of some of the CI flakes. Maybe even all?
It's not clear why the tests have been working reliably for years
under overlay, and only started failing under vfs, but shrug.

Thanks to Chris for making that astute observation.

Fixes: #20282  (I hope)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-05 11:58:42 -07:00
Odilon Sousa 7cc6501cf0 Add e2e tests for quadlet Entrypoint option
Drop bats tests for quadlet Entrypoint

Signed-off-by: Odilon Sousa <osousa@redhat.com>
2023-12-05 10:14:11 -03:00
Giuseppe Scrivano 01d397a658
podman: new option --preserve-fd
add a new option --preserve-fd that allows to specify a list of FDs to
pass down to the container.

It is similar to --preserve-fds but it allows to specify a list of FDs
instead of the maximum FD number to preserve.

--preserve-fd and --preserve-fds are mutually exclusive.

It requires crun since runc would complain if any fd below
--preserve-fds is not preserved.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-05 10:16:41 +01:00
Ygal Blum a943be7e8e Kube Play - set ReportWriter when building an image
Add test for a specific crash
Update play build test to expect message in stderr

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-05 09:45:21 +02:00
Odilon Sousa 972ffaca4d Add support for Entrypoint in quadlet
This PR closes #20585

Add Inital support for Entrypoint on quadlets
Add Bats Tests for Entrypoint
Updates the documentation with one example to use the Entrypoint option

Signed-off-by: Odilon Sousa <osousa@redhat.com>
2023-12-04 23:38:53 -03:00
openshift-merge-bot[bot] fc816e18cd
Merge pull request #20898 from edsantiago/systemctl_debug
systests: debug systemd failures
2023-12-04 18:03:16 +00:00
Ed Santiago 1f42aff933 systests: debug systemd failures
When a systemd-related system test fails, we usually get:

    systemctl start foo
    FAILED exit status 1, try 'systemctl --status' or 'journalctl -xe'

That makes it impossible to debug flakes.

Solution: new systemctl_start() [note underscore], to be used
instead of systemctl <SPACE> start. On failure, will run log
commands.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-04 09:28:49 -07:00
Ed Santiago 7f4b0f2087 apiv2 tests: fix race
Test flaking because (I think) one-second resolution isn't
good enough for --since. Use NS resolution.

Also, more test-name cleanup: strip off timestamps in 'since='.
This yields consistent test names in logs, which makes it easier
for me to categorize flakes.

Fixes: #20896

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-12-04 09:18:25 -07:00
openshift-merge-bot[bot] 093868b37f
Merge pull request #20887 from ygalblum/quadlet-pod-quadlet-based-keys
Quadlet - add support for keys that may refer to other Quadlet units in `.pod` files
2023-12-04 13:23:10 +00:00
openshift-merge-bot[bot] 8d0be64093
Merge pull request #20829 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.2
2023-12-04 01:59:49 +00:00
openshift-merge-bot[bot] 5af152ec29
Merge pull request #20874 from mheon/eval_symlinks_on_db_paths
Handle symlinks when checking DB vs runtime configs
2023-12-03 11:50:03 +00:00
Ygal Blum 7e2a8d58ab Quadlet .pod - add support for the Volume Key
Add e2e tests
Update documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-03 10:23:13 +02:00
Ygal Blum 212b4c9e93 Quadlet .pod - add support for the Network Key
Add e2e tests
Update documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-03 10:22:33 +02:00
Matt Heon f384bdf66b Handle symlinks when checking DB vs runtime configs
When Podman starts, it checks a number of critical runtime paths
against stored values in the database to make sure that existing
containers are not broken by a configuration change. We recently
made some changes to this logic to make our handling of the some
options more sane (StaticDir in particular was set based on other
passed options in a way that was not particularly sane) which has
made the logic more sensitive to paths with symlinks. As a simple
fix, handle symlinks properly in our DB vs runtime comparisons.

The BoltDB bits are uglier because very, very old Podman versions
sometimes did not stuff a proper value in the database and
instead used the empty string. SQLite is new enough that we don't
have to worry about such things.

Fixes #20872

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-12-02 15:48:47 -05:00
openshift-merge-bot[bot] bc124dd13f
Merge pull request #20819 from cgiradkar/20752_farm_flag_move
Move the --farm flag to farm build command
2023-12-01 21:12:38 +00:00
openshift-merge-bot[bot] c47962802a
Merge pull request #20657 from nalind/commit-config
RHEL-14922: accept a config blob alongside the "changes" slice when committing
2023-12-01 21:09:23 +00:00
openshift-merge-bot[bot] 3b03e85471
Merge pull request #20789 from umohnani8/healthcheck
Don't update health check status during initialDelaySeconds
2023-12-01 13:12:50 +00:00
renovate[bot] 269f8ff066
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-30 14:53:34 +00:00
Chetan Giradkar 31df9c237e Move the --farm flag to farm build command
The option `farm` which is used to specify the farm to be used, is moved to farm build command from farm command.

closes #20752

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-30 14:27:06 +00:00
Nalin Dahyabhai 426db6fcc1 Accept a config blob alongside the "changes" slice when committing
When committing containers to create new images, accept a container
config blob being passed in the body of the API request by adding a
Config field to our API structures.  Populate it from the body of
requests that we receive, and use its contents as the body of requests
that we make.

Make the libpod commit endpoint split changes values at newlines, just
like the compat endpoint does.

Pass both the config blob and the "changes" slice to buildah's Commit()
API, so that it can handle cases where they overlap or conflict.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:00:52 -05:00
Ed Santiago f95dd21d5d deferred test failures: handle a corner case
Followup to #20797 (defer assertion failures). The bail-now()
helper was being defined only in setup() ... and some tests,
particularly 001-basic.bats, define their own minimalist setup().

Symptom was "bail-now: command not found", which still caused
test to fail (so no failures were hidden) but led to concern
and wasted time when analyzing failures.

Solution: add one more definition of bail-now(), in outer scope.

There is still one pathological case I'm not addressing: a
bats file that defines its own teardown() which does not invoke
basic_teardown(), then has a test that runs defer-assertion-failures
without a followup immediate-assertion-failures. This would lead
to failures that are never seen. Since teardown() without basic_teardown()
is invalid, I choose not to worry about this case.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-30 06:33:46 -07:00
openshift-merge-bot[bot] 572a7692e3
Merge pull request #20828 from alexlarsson/quadlet-snippets
quadlet: Support systemd style dropin files
2023-11-29 23:24:33 +00:00
Ed Santiago 3e70415089 Gating test fixes
Two newly-added tests, fail in gating:
 - system connection: difference in how sockets are set up
   between CI and gating
 - ulimit: gating seems to run with ulimit -c -H 0. Check, and
   skip if ulimit is less than what we need

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-29 07:51:43 -07:00
Urvashi Mohnani f35d1c1c25 Don't update health check status during initialDelaySeconds
When InitialDelaySeconds in the kube yaml is set for a helthcheck,
don't update the healthcheck status till those initial delay seconds are over.
We were waiting to update for a failing healtcheck, but when the healthcheck
was successful during the initial delay time, the status was being updated as healthy
immediately.
This is misleading to the users wondering why their healthcheck takes
much longer to fail for a failing case while it is quick to succeed for
a healthy case. It also doesn't match what the k8s InitialDelaySeconds
does. This change is only for kube play, podman healthcheck run is
unaffected.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-11-29 08:37:39 -05:00
Alexander Larsson 8ee2622028 quadlet: Support systemd style dropin files
For a source file like `foo.container`, look for drop in named
`foo.container.d/*.conf` and merged them into the main file.  The
dropins are applied in alphabetical order, and files in earlier
diretories override later files with same name.

This is similar to how systemd dropins work, see:
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

Also adds some tests for these

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2023-11-29 13:46:52 +01:00
openshift-merge-bot[bot] 6d9d8f06ce
Merge pull request #20517 from rhatdan/mask
Get masked paths and readonly masked patchs from containers/common @rhatdan
2023-11-29 02:12:37 +00:00
openshift-merge-bot[bot] 21951e2376
Merge pull request #20799 from edsantiago/symlink-mounts
[systests] podman mount no-dereference: complete rewrite
2023-11-29 01:14:48 +00:00
openshift-merge-bot[bot] 83c08a2f5c
Merge pull request #20609 from cgiradkar/19124_remove_event_fix
Set correct exitcode in remove events
2023-11-28 16:21:17 +00:00
openshift-merge-bot[bot] 545daed1e4
Merge pull request #20762 from ygalblum/quadlet-pod
Quadlet - Add support for .pod units
2023-11-28 14:44:00 +00:00
Chetan Giradkar 572f38c0db Set correct exitcode in remove events and change ContainerExitCode from int to int ptr
Added additional check for event type to be remove and set the correct exitcode.
While it was getting difficult to maintain the omitempty notation for Event->ContainerExitCode, changing the type from int to int ptr gives us the ability to check for ContainerExitCode to be not nil and continue operations from there.

closes #19124

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-28 13:31:18 +00:00
Ygal Blum 6b2f48129e Quadlet - Add support for .pod units
Add support for .pod unit files with only PodmanArgs, GlobalArgs, ContainersConfModule and PodName
Add support for linking .container units with .pod ones
Add e2e and system tests
Add to man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-28 14:31:53 +02:00
Ed Santiago c664cfe886 [systests] podman mount no-dereference: complete rewrite
Existing test was very good, but as a multidimensional table it
was unmaintainable... and actually missed one corner case.

This version isn't much better. It's far longer, codewise. It
is a little harder to understand at first glance. It has three
uncomfortable magic conditionals. But I believe it is more
long-term maintainable: beyond the first glance, it is possible
for a human to check it for correctness. It is also extensible,
as proved by the new test cases I added.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-28 04:45:51 -07:00
openshift-merge-bot[bot] 720a0ead3a
Merge pull request #20797 from edsantiago/defer_assert_failures
[systests] new defer-assertion-failure
2023-11-28 10:56:56 +00:00
renovate[bot] 07a7b3ae5d
fix(deps): update module golang.org/x/tools to v0.16.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 01:59:00 +00:00
Ed Santiago 29d18079cb [systests] new defer-assertion-failure
Some system tests run deep loops:

  for x in a b c; do
    for y in d e f; do
        .... check condition $x + $y

Normally, if one of these fails, game over. This can be frustrating
to a developer looking for failure patterns.

Here we introduce a new defer-assertion-failure function, meant
to be called before loops like these. Everything is the same,
except that tests will continue running even after failure.

When test finishes, or if test runs immediate-assertion-failure,
a new message indicates that multiple tests failed:

  FAIL: X test assertions failed. Search for 'FAIL': above this line.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-27 11:31:29 -07:00
Paul Holzinger d280e481a5
test/compose: remove debug leftovers
I noticed these old debug code while looking at a log. These were
needed to debug a nasty flake[1] in the compose tests. However
it has been fixed[2] for a while and I am not aware of any flakes
around that logic so we are good to remove it.

I still leave the server logs in there as they may be useful for all
kinds of issues and are only printed when the test fails so it does not
clutter the logs.

[1] https://github.com/containers/podman/issues/10052
[2] https://github.com/containers/podman/pull/11091

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-27 18:02:26 +01:00
openshift-merge-bot[bot] 1486ee5189
Merge pull request #20744 from rhatdan/pod
If API calls for kube play --replace, then replace pod
2023-11-25 13:46:56 +00:00
openshift-merge-bot[bot] b4eb88fca4
Merge pull request #20746 from rhatdan/selinux
Ignore SELinux relabel on unsupported file systems
2023-11-23 01:11:02 +00:00
Daniel J Walsh 75638a72a8
If API calls for kube play --replace, then replace pod
Currently if user specifies podman kube play --replace, the
pod is removed on the client side, not the server side.  If
the API is called with replace=true, the pod was not being removed
and this called the API to fail. This PR removes the pod if it
exists and the caller specifies replace=true.

Fixes: https://github.com/containers/podman/discussions/20705

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-22 13:31:24 -05:00
openshift-merge-bot[bot] 2f160f850f
Merge pull request #20714 from deuill/quadlet-notify-healthy
quadlet: Support `healthy` for `Notify` directives
2023-11-22 15:52:29 +00:00
Daniel J Walsh ddd6cdfd77
Ignore SELinux relabel on unsupported file systems
We were ignoreing relabel requests on certain unsupported
file systems and not on others, this changes to consistently
logrus.Debug ENOTSUP file systems.

Fixes: https://github.com/containers/podman/discussions/20745

Still needs some work on the Buildah side.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-22 09:25:38 -05:00
Alex Palaistras 6cb2f9b122 quadlet: Support `healthy` for `Notify` directives
This expands support for the (previously) boolean `Notify` directive, in
support of healthcheck determined SD-NOTIFY event emission, as
supported by Podman with the `--sdnotify=healthy` option.

Closes: #18189
Signed-off-by: Alex Palaistras <alex@deuill.org>
2023-11-21 18:08:48 +00:00
openshift-merge-bot[bot] ee5f582fbc
Merge pull request #20356 from vrothberg/RUN-1935
new 'no-dereference' mount option
2023-11-21 14:40:03 +00:00
openshift-merge-bot[bot] a6510d9310
Merge pull request #20725 from ashley-cui/updatemain
Bump main to 5.0.0-dev
2023-11-21 13:05:18 +00:00
Valentin Rothberg e40d70cecc new 'no-dereference' mount option
Add a new `no-dereference` mount option supported by crun 1.11+ to
re-create/copy a symlink if it's the source of a mount.  By default the
kernel will resolve the symlink on the host and mount the target.
As reported in #20098, there are use cases where the symlink structure
must be preserved by all means.

Fixes: #20098
Fixes: issues.redhat.com/browse/RUN-1935
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-11-21 13:17:58 +01:00
Ashley Cui be24633300 Bump to v5.0.0-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-20 15:10:17 -05:00
renovate[bot] e75fbe54e2
Update dependency setuptools to v69
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-20 18:13:43 +00:00
Daniel J Walsh 62060f3234
Get masked paths and readonly masked patchs from containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-19 10:01:20 -05:00
openshift-merge-bot[bot] 149d4f079a
Merge pull request #20161 from edsantiago/ci_desired_storage
CI: test overlay and vfs
2023-11-18 20:59:17 +00:00
Miloslav Trmač d0b32255e4 Add support for --compat-auth-file in login/logout
This mostly just inherits the c/common/pkg/auth implementation,
except that AuthFilePath and DockerCompatAuthFilePath can not be set
simultaneously, so don't unnecessarily explicitly set AuthFilePath.
c/common already handles that.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-17 16:44:06 +01:00
Miloslav Trmač a3d5814e0e Update tests for a c/common error message change
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-17 16:44:06 +01:00
Ed Santiago a10b88cb2f CI: test overlay and vfs
We're only testing vfs in CI. That's bad. #18822 tried to
remedy that but that only worked on system tests, not e2e.

Here we introduce CI_DESIRED_STORAGE, to be set in .cirrus.yml
in the same vein as all the other CI_DESIRED_X. Since it's 2023
we default to overlay, testing vfs only in priorfedora.

Fixes required:
 - e2e tests:
   - in cleanup, umount ROOT/overlay to avoid leaking mounts

 - system tests:
   - fix a few badly-written tests that assumed/hardcoded overlay
   - buildx test: add weird exception to device-number test
   - mount tests: add special case code for vfs
   - unprivileged test: disable one section that is N/A on vfs

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-17 05:48:50 -07:00
Ed Santiago d2a4ec867d Test fixes for debian
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-16 15:14:36 -07:00
Ed Santiago 23ead49dee pasta tests: remove some skips
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-16 15:14:36 -07:00
openshift-merge-bot[bot] 638199c495
Merge pull request #20671 from ygalblum/quadlet-uidmap
Quadlet - add support for UID and GID Mapping
2023-11-16 15:40:37 +00:00
Ygal Blum e35fc92c02 Quadlet - add support for UID and GID Mapping
Support UIDMap, GIDMap, SubUIDMap and SubGIDMap
If any of them are set disregard the deprecated Remap keys
Add tests and man

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-15 12:10:22 +02:00
Ygal Blum dc709e4d76 Quadlet - Allow using symlink on the base search paths
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-15 09:58:28 +02:00
Ed Santiago 047da19b5f (Temporary) Emergency CI fix: quay search is broken
Someone please revert this once quay search is fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-13 06:52:10 -07:00
openshift-merge-bot[bot] a3f8f8c1c3
Merge pull request #20652 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.1
2023-11-13 12:06:13 +00:00
openshift-merge-bot[bot] 8e6fe99fdb
Merge pull request #20662 from ygalblum/quadlet-mount-equal-sign
Quadlet test - add case for multi = sign in mount
2023-11-13 08:09:50 +00:00
Ygal Blum bd375058cf Quadlet test - add case for multi = sign in mount
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-12 10:10:42 +02:00
Ed Santiago 6b5b399121 CI: e2e: fix a smattering of test bugs that slipped in
...while Ed was napping:
 - create/run based on remote image: was not actually testing anything
 - create/run --tls-verify: ditto
 - run --decryption-key: sort of testing but not really
 - Fail(), not Skip(), if we can't start registry.
 - never Skip() halfway through a test: emit a message, and return

The Skip-in-the-middle thing deserves to be shouted from the rooftops.
Let's please never do that again. Skip() says "this entire test was
skipped", which can be misleading to a spelunker trying to track
down a problem related to those tests.

Also, more minor:
 - reduce use of port 5000
 - rename a confusingly-named test

Ref: #11205, #12009

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-10 13:41:34 -07:00
renovate[bot] d07263f348
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-10 18:31:35 +00:00
openshift-merge-bot[bot] bc7c01d195
Merge pull request #20638 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.15.0
2023-11-10 16:03:59 +00:00
openshift-merge-bot[bot] 7d107b9892
Merge pull request #19879 from rhatdan/ulimits
Support passing of Ulimits as -1 to mean max
2023-11-10 10:47:43 +00:00
renovate[bot] 5388836c11
fix(deps): update module golang.org/x/tools to v0.15.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 02:16:55 +00:00
openshift-merge-bot[bot] 01fd9e906b
Merge pull request #20620 from baude/codecleanup
Automatic code cleanups - JetBrains
2023-11-08 22:14:36 +00:00
openshift-merge-bot[bot] 6bb2edd215
Merge pull request #20608 from rhatdan/codespell
Run codespell on podman
2023-11-08 08:30:43 +00:00
Brent Baude 78798cab00 Automatic code cleanups - JetBrains
A bunch of cleanups as suggested by linters/etc in JetBrains IDE.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-07 14:05:15 -06:00
openshift-merge-bot[bot] 111b2337f9
Merge pull request #20613 from edsantiago/doublecheck_db
systests: add a last-minute check for db backend
2023-11-07 16:18:35 +00:00
Ed Santiago 1c969219d4 systests: add [NNN] prefix in logs, NNN = filename
This is something I've long wanted in logs: an indicator of
which bats file the test lives in. As of v1.7.0 there is
now a way to do that, BATS_TEST_NAME_PREFIX. Use it. Logs
now look like:

     ok 14 [001] podman - shutdown engines
     ok 15 [005] podman info - basic test
     ...
     not ok 195 [065] podman cp - dot notation ....

(As a bonus, we can remove the super-long "test blah blah pasta"
duplication from 505.bats).

Also, removed no-longer-necessary (fingers crossed) debug code
for the recently fixed containers-storage umount/EINVAL flake.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-06 14:45:45 -07:00
Ed Santiago 92cd7b25f2 systests: add a last-minute check for db backend
This will only fail if someone ever adds a system test that
runs podman with "--db-backend boltdb", which nobody should
ever do, but this is a cheap way to make sure it never happens.

See #20563

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-06 14:15:28 -07:00
Daniel J Walsh c2de6d34ca
Run codespell on podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-06 09:23:16 -06:00
Daniel J Walsh 420316ef6e
Podman push --help should reveal default compression
When using the local client, we should display the compression
algorithm.

If the compression level is set, then show this also.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-04 07:33:53 -05:00
openshift-ci[bot] b44d372b1b
Merge pull request #20559 from edsantiago/ci_default_sqlite
CI: default to sqlite
2023-11-03 18:56:29 +00:00
Aditya R 607aff55fa
remote,test: remove .dockerignore which is a symlink
It seems certain test infrastructure prevents cloning repo which
contains symlink outside of the repo itself, generate symlink for such
test by the testsuite itself just before running test and remove it when
test is completed.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-11-03 20:39:02 +05:30
Ed Santiago 2a17baa29d CI: default to sqlite
Followup to #20318: now that sqlite is the podman default,
enforce that in CI as well. Test boltdb only in Prior Fedora.

In the process, discovered & cleaned up some duplication
and unused YAML anchors.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-02 13:17:21 -06:00
Daniel J Walsh af0ef47f0c
Add status messages to podman --remote commit
Fixes: https://github.com/containers/podman/issues/19947

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-01 14:31:09 -04:00
openshift-ci[bot] f84dba2273
Merge pull request #20506 from edsantiago/farm_tests
CI: podman farm tests cleanup
2023-11-01 13:19:51 +00:00
Daniel J Walsh 18d6bb40d5
Support passing of Ulimits as -1 to mean max
Docker allows the passing of -1 to indicate the maximum limit
allowed for the current process.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-01 08:46:55 -04:00
openshift-ci[bot] 2972f5941f
Merge pull request #20545 from giuseppe/fix-hostname-with-host-uts
libpod: fix /etc/hostname with --uts=host
2023-10-31 14:05:52 +00:00
Giuseppe Scrivano b332ca7a02
libpod: fix /etc/hostname with --uts=host
when --uts=host is provided, the expectation is to use the hostname
from the host not the container name.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-31 13:02:17 +01:00
openshift-ci[bot] 4eb02346d5
Merge pull request #20536 from edsantiago/pasta_timeout_tweaks
systests: pasta: avoid hangs
2023-10-31 11:58:57 +00:00
openshift-ci[bot] 735e243319
Merge pull request #20539 from edsantiago/stty_flake
systests: stty test: retry once on flake
2023-10-31 07:55:49 +00:00
openshift-ci[bot] 377644640a
Merge pull request #20476 from rhatdan/build
podman build --remote URI Dockerfile should not be treated as file
2023-10-31 07:49:59 +00:00
Ed Santiago 89d7b27357 systests: stty test: retry once on flake
I've seen the stty flake (#10710) twice in one day. Time to
add a retry.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-30 19:13:30 -06:00
Ed Santiago 6b94c8fd31 systests: pasta: avoid hangs
Under some circumstances BATS tests hang, causing a CI timeout.

One prominent reason is pasta test failures: BATS will not
exit until all child processes are finished, and in some
environments the socat client can stay forever.

Workaround: run socat with a timeout, and with limited retries.

Tested on an f38 system with broken IPv6: without this fix,
bats hangs until I ^C. With this fix, bats exits as it should.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-30 12:53:05 -06:00
openshift-ci[bot] 4871182422
Merge pull request #20457 from rhatdan/pod
podman kube play --replace should force removal of pods and containers
2023-10-30 11:51:19 +00:00
openshift-ci[bot] 77d2658201
Merge pull request #20369 from cgiradkar/Issue-16759-docs
Define better error message for container name conflicts with external storage
2023-10-30 10:22:00 +00:00
Daniel J Walsh a1577ec7b0
podman build --remote URI Dockerfile shoud not be treated as file
Podman build --remote is translating https://path as if it was a file
path. This change will leave it as a URL so it can be parsed on the
server side.

Fixed: https://github.com/containers/podman/issues/20475

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 15:10:18 -04:00
openshift-ci[bot] 4f6a8f0d50
Merge pull request #20483 from vrothberg/RUN-1934
container.conf: support attributed string slices
2023-10-27 17:49:13 +00:00
Daniel J Walsh 91df369ae6
podman kube play --replace should force removal of pods and containers
Fixes: https://github.com/containers/podman/issues/20025

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 07:29:53 -04:00
Valentin Rothberg e966c86d98 container.conf: support attributed string slices
All `[]string`s in containers.conf have now been migrated to attributed
string slices which require some adjustments in Buildah and Podman.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-27 12:44:33 +02:00
openshift-ci[bot] 7d5af58bd7
Merge pull request #20501 from mheon/powercap
Mask /sys/devices/virtual/powercap
2023-10-27 08:04:52 +00:00
Ed Santiago 91ccd7cd2f CI: podman farm tests cleanup
Followup from #20050. Lots of tiny problems in tests, all of
them adding up to significant maintainability problems.

These tests are currently impossible to run in a dev environment,
and super-painful to set up in 1mt, so I've just done a few hours
of cleanup and am giving up for the week.

This is ready for merge, in the sense that it's much better than
what exists now, but it still needs boatloads more work.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 18:12:07 -06:00
Matthew Heon be7dd128ef Mask /sys/devices/virtual/powercap
I don't really like this solution because it can't be undone by
`--security-opt unmask=all` but I don't see another way to make
this retroactive. We can potentially change things up to do this
the right way with 5.0 (actually have it in the list of masked
paths, as opposed to adding at spec finalization as now).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-10-26 18:24:25 -04:00
Ed Santiago 9e3363c5e3 CI: systest: safer random_rfc1918_subnet
Our aarch64 CI system uses 172.31.0.0/20. Because I was (and am)
lazy, my random_rfc1918_subnet() helper was only checking /24.
This causes flakes.

Solution is to actually do it right: binary arithmetic, prefix
matching. This is effectively impossible in bash, so, use a
hairy perl helper and add copious tests.

Fixes: #18693

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 09:19:32 -06:00
Ed Santiago c841fa9e9a CI: e2e: safer GetPort()
Problem: frequent CI flakes of the form:

   Error: cannot listen on the TCP port: listen tcp4 :5355: bind: address already in use

Always 5355.

Cause: systemd-resolve listens on 5355, but not on 127.0.0.1. So
when GetPort() tries its is-it-in-use check by binding localhost,
it succeeds; but then podman binds * and fails.

Solution: GetPort(): test by binding 0.0.0.0.

Also, improve the failure message.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 05:52:02 -06:00
openshift-ci[bot] 0242a7439e
Merge pull request #20470 from edsantiago/curl_port_flake_fix
CI: try to fix more networking flakes
2023-10-25 21:17:03 +00:00
openshift-ci[bot] 5a47b1e150
Merge pull request #20050 from umohnani8/farm-build-2
Add podman farm build command
2023-10-25 19:54:36 +00:00
openshift-ci[bot] 32ef2d7080
Merge pull request #20479 from ygalblum/quadlet-read-only
Quadlet - explicit support for read-only-tmpfs
2023-10-25 19:28:07 +00:00
Ed Santiago c0fb8fe594 CI: try to fix more networking flakes
There's a whole slew of networking-related flakes whose common
element seems to be improper use of curl. Fix those by:

  * add --retry --retry-connrefused; and/or
  * add -S ("show errors". Plain -s silences everything!); and/or
  * test exit status from curl; and/or
  * add wait_for_port after "podman run -d", to avoid races
  * log commands, to make debugging easier

Important note: wait_for_port() was not working with rootless
podman ports. Trivial proof:

  $ podman run -d --name foo -p 8192:80 \
      quay.io/libpod/testimage:20221018 \
      /bin/busybox-extras httpd -f -p 80
  $ grep :2000 /proc/net/tcp
  [no results]

Solution: use ss tool; it seems to handle this just fine.
There may be a better solution.

Oh, also, add -t1 to a podman restart, to shave 18s from test run.

Fixes: #20335 and, I think, a handful of others

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-25 07:24:16 -06:00
openshift-ci[bot] 556898511c
Merge pull request #20481 from vrothberg/fix-20469
compat API: fix image-prune --all
2023-10-25 11:29:30 +00:00
Ygal Blum 76cca08f8a Quadlet - explicit support for read-only-tmpfs
Add Quadlet key and disconnect relationship withr read-only
Update and add tests
Update man with new key

Remove the reference to VolatileTmpfs in the man page to reduce its
usage, since the same functionality can be achieved using the Tmpfs key
while keeping its support to maintain backward compatibility

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-25 13:28:15 +03:00
Valentin Rothberg c13b8e3c9c compat API: fix image-prune --all
Docker deals with the --all flag on the client side while Podman does it
on the server side.  Hence, make sure to not set the dangling filter
with two different values in the backend.

Fixes: #20469
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-25 10:58:00 +02:00
Ygal Blum 0e15861c59 Makefile - allow more control over Ginkgo parameters
Allow the user to control flake retry and color output
Update README

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-25 09:48:36 +03:00
Urvashi Mohnani ebe01ca292 Add e2e tests for farm build
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-24 17:32:47 -04:00
Valentin Rothberg 989afd910e vendor c/{buildah,common}: appendable containers.conf strings, Part 1
This change is the first step of integrating appendable string arrays
into containers.conf and starts with enabling the `Env`, `Mounts`, and
`Volumes` fields in the `[Containers]` table.

Both, Buildah and Podman, read (and sometimes write) the fields of the
`Config` struct at various places, so I decided to migrate the fields
step-by-step.  The ones in this change are most critical ones for
customers.  Once all string slices/arrays are migrated, the docs of
containers.conf will be updated.  The current changes are entirely
transparent to users.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-24 20:33:36 +02:00
openshift-ci[bot] e9e18acd5f
Merge pull request #20451 from rhatdan/volume
Support size option when creating tmpfs volumes
2023-10-24 15:40:50 +00:00
openshift-ci[bot] 83d7c3849f
Merge pull request #20464 from Luap99/libpod-remote
add !remote tag to packages that should not be included in the remote client + vendor c/common
2023-10-24 15:33:03 +00:00
Paul Holzinger 1b466ccbdc
test/e2e: do not import buildah
We only care about the version so just import the define package for it,
the main buildah package causes big transitive imports which fail to
build with the remote tag (i.e. libimage)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-24 13:52:15 +02:00
openshift-ci[bot] ed58ea7849
Merge pull request #20422 from sstosh/api-skip-cgroupv1
test/apiv2: adapt apiv2 test on cgroups v1 environment
2023-10-24 11:23:51 +00:00