Commit Graph

1517 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] abb94397f9
Merge pull request #21585 from Luap99/port-range-flake
fix "podman run port forward range" flake
2024-02-09 17:04:32 +00:00
Paul Holzinger 1ca608ea99
fix "podman run port forward range" flake
For some reason this starting to flake f38. I don't think the issue in
podman rather the test start nc -l in the background so it may not yet
have bound the port in the container when we try to connect.
To fix this simply add some retry logic to nc.

While at it also add pasta to this test and make it use
defer-assertion-failures to run all loop iterations before reporting the
errors.

Fixes #21561 (hopefully)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-09 14:34:34 +01:00
Ed Santiago dbfa201c9a new testimage and systemd-image
Simply because it's been a while since the last testimage
build, and I want to confirm that our image build process
still works.

Added /home/podman/healthcheck. This saves us having to
podman-build on each healthcheck test. Removed now-
unneeded _build_health_check_image helper.

testimage: bump alpine 3.16.2 to 3.19.0

systemd-image: f38 to f39
  - tzdata now requires dnf **install**, not reinstall
    (this is exactly the sort of thing I was looking for)

PROBLEMS DISCOVERED:
  - in e2e, fedoraMinimal is now == SYSTEMD_IMAGE. This
    screws up some of the image-count tests (CACHE_IMAGES).

  - "alter tarball" system test now barfs with tar < 1.35.

TODO: completely replace fedoraMinimal with SYSTEMD_IMAGE
in all tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-09 05:26:07 -07:00
openshift-merge-bot[bot] 4c9bd246c3
Merge pull request #21514 from Luap99/pod-inspect-output
make podman pod inspect output a json array
2024-02-08 11:31:40 +00:00
openshift-merge-bot[bot] 8a6165e592
Merge pull request #21522 from Luap99/restart-userns
fix userns + restart policy with slirp4netns
2024-02-08 10:41:54 +00:00
Paul Holzinger 7d15bc2efb
fix userns + restart policy with slirp4netns
Currently we deadlock in the slirp4netns setup code as we try to
configure an non exissting netns. The problem happens because we tear
down the netns in the userns case correctly since commit bbd6281ecc but
that introduces this slirp4netns problem. The code does a proper new
network setup later so we should only use the short cut when not in a
userns.

Fixes #21477

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-06 13:50:07 +01:00
Lokesh Mandvekar 01a8539ef0
Warn if cgroups-v1
Podman v5 will not support cgroups-v1. This commit will print a warning
if it detects a cgroups-v1 system. The warning can be hidden by setting
envvar `PODMAN_CGROUPSV1_WARNING`.

This warning is patched out for RHEL 9 builds as cgroups-v1 will still
be supported on RHEL 9 systems.

Resolves: https://issues.redhat.com/browse/RUN-1957

[NO NEW TESTS NEEDED]

Co-authored-by: Ed Santiago <santiago@redhat.com>
Co-authored-by: Sascha Grunert <sgrunert@redhat.com>
Co-authored-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-02-06 16:18:05 +05:30
Paul Holzinger 35d1f12213
make podman pod inspect output a json array
Just like all the other inspect commands that accept multiple args we
should just make podman pod inspect output a json array.
This makes the code more consistent and removes the extra workaround
which was needed before to support this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-05 17:26:55 +01:00
Ashley Cui 26cd01ee51 Do not test CNI in CI
CNI is deprecated and is build tagged out for 5.0. Don't test it in our CI.
This commit also disables upgrade tests for now - those need more work since the old version of Podman only uses CNI. Upgrade tests will be re-vamped in a later commit.
Signed-off-by: Ashley Cui <acui@redhat.com>
2024-02-05 11:01:21 -05:00
Daniel J Walsh 0da4054534
Verify the empty mounts.conf does not generate warnings.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-01 20:12:08 -05:00
Paul Holzinger 74454bf59c
rework system connection and farm storage
We now no longer write containers.conf, instead system connections and
farms are written to a new file called podman-connections.conf.

This is a major rework and I had to change a lot of things to get this
to compile again with my c/common changes.

It is a breaking change for users as connections/farms added before this
commit can now no longer be removed or modified directly. However because
the logic keeps reading from containers.conf the old connections can
still be used to connect to a remote host.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-01-31 15:08:41 +01:00
Matt Heon 174631f726 Convert SpecGen values to be nullable where possible
SpecGen is our primary container creation abstraction, and is
used to connect our CLI to the Libpod container creation backend.
Because container creation has a million options (I exaggerate
only slightly), the struct is composed of several other structs,
many of which are quite large.

The core problem is that SpecGen is also an API type - it's used
in remote Podman. There, we have a client and a server, and we
want to respect the server's containers.conf. But how do we tell
what parts of SpecGen were set by the client explicitly, and what
parts were not? If we're not using nullable values, an explicit
empty string and a value never being set are identical - and we
can't tell if it's safe to grab a default from the server's
containers.conf.

Fortunately, we only really need to do this for booleans. An
empty string is sufficient to tell us that a string was unset
(even if the user explicitly gave us an empty string for an
option, filling in a default from the config file is acceptable).
This makes things a lot simpler. My initial attempt at this
changed everything, including strings, and it was far larger and
more painful.

Also, begin the first steps of removing all uses of
containers.conf defaults from client-side. Two are gone entirely,
the rest are marked as remove-when-possible.

[NO NEW TESTS NEEDED] This is just a refactor.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-01-30 10:42:24 -05:00
openshift-merge-bot[bot] 37bff82246
Merge pull request #21397 from rhatdan/codespell
Run codespell on code
2024-01-29 09:17:33 +00:00
Daniel J Walsh 8d14d41555
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-28 07:30:52 -05:00
Urvashi Mohnani 202cab6124 Fix inspect test that rely on digest
Given that we can have multiple image digests,
fix the inspect test to check whether the digest
given matches one of the digests of the image.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-25 15:05:48 -05:00
openshift-merge-bot[bot] 97cd376e7f
Merge pull request #21300 from mheon/deprecate_boltdb
Deprecate BoltDB, preventing creation of new databases.
2024-01-23 22:11:24 +00:00
Matt Heon cf0b436b96 Deprecate BoltDB, preventing creation of new databases.
This is one of the breaking changes in Podman 5.0: removing the
ability to create new instances of the old Bolt database. This
does not remove support for the database entirely, as existing
Bolt databases will still be usable, but all new installs will
use SQLite after this point - if Bolt is forced by config, we'll
just error.

We don't have plans to outright remove the Bolt code. If that
were to happen, it'd be Podman 6.0 at least, and a significant
enough change it'd warrant a lot of discussion and planning. We
do intend to start winding down support of BoltDB, though, and
new features may be added only to SQLite from here on.

I have added an escape hatch via an undocumented environment
variable that allows us to continue testing BoltDB in CI (and, if
necessary, locally) but I don't want this to be used for any
purpose except continued testing of the old DB to ensure we don't
break it.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-01-23 12:56:49 -05:00
Alberto Faria 5cc83da1c6 Pass the OCI runtime an empty entrypoint when there is no entrypoint
Some OCI runtimes (cf. [1]) may tolerate container images that don't
specify an entrypoint even if no entrypoint is given on the command
line. In those cases, it's annoying for the user to have to pass a ""
argument to podman.

If no entrypoint is given, make the behavior the same as if an empty ""
entrypoint was given.

[1] https://github.com/containers/crun-vm

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-23 10:10:44 +00:00
openshift-merge-bot[bot] d38ee1364d
Merge pull request #21267 from danishprakash/new-pod-behavior
rm pod with run, create if ctr creation failed with --pod new:
2024-01-17 20:20:52 +00:00
danishprakash 1c88b12204
rm pod with podman run if ctr creation failed
Currently, if the container creation failed with
either run or create and you've used --pod with new:
the pod would be created nonetheless. This change ensures
the pod just created is also cleaned up in case
of container creation failure

Fixes #21228

Signed-off-by: danishprakash <danish.prakash@suse.com>
2024-01-17 18:59:32 +05:30
Ed Santiago e66413b51b CI: reenable tests that are working again
- #15074 ("subtree_control" flake). The flake is NOT FIXED, I
  saw it six months ago on my (non-aarch64) laptop. However,
  it looks like the frequent-flake-on-aarch64 bug is resolved.
  I've been testing in #17831 and have not seen it. So,
  tentatively remove the skip and see what happens.

- Closes: #19407 (broken tar, "duplicates of file paths")
  All Fedoras now have a fixed tar. Debian DOES NOT, but
  we're handling that in our build-ci-vm code. I.e., the
  Debian VM we're using has a working tar even though there's
  currently a broken tar out in the wild.

  Added distro-integration tag so we can catch future problems
  like this in OpenQA.

- Closes: #19471 (brq / blkio / loopbackfs in rawhide)
  Bug appears to be fixed in rawhide, at least in the VMs we're
  using now.

  Added distro-integration tag because this test obviously
  relies on other system stuff.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-16 10:07:48 -07:00
Ed Santiago 0e09527bd2 systests: kube with policies test: fix race
Add a wait_for_ready() to one kube-play test, to make sure
container output has made it to the journal.

Probably does not fix #18501, but I think it might fix its
most common presentation.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-11 13:04:41 -07:00
openshift-merge-bot[bot] 83f89db6c8
Merge pull request #20961 from karuboniru/patch-1
fix checking of relative idmapped mount
2024-01-11 17:20:56 +00:00
openshift-merge-bot[bot] 28b5a6e5f0
Merge pull request #21201 from edsantiago/rhel8_gating
System tests: fixes for RHEL8 gating failures
2024-01-10 11:18:32 +00:00
Ming Liu 4e4c3e3dbf cmd: support --config option to locate authentication file
Let's support --config option by setting environment variable
DOCKER_CONFIG instead of ignoring it for docker compatibility, so
it could be used to locate config.json as authentication file.

Also add a test case for this change, remove the deprecated one.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2024-01-10 09:31:43 +01:00
Ed Santiago 780733415b System tests: fixes for RHEL8 gating failures
- tmpfs + noswap test: requires noswap feature in kernel.
  Check for it, and skip if unimplemented. (Root only.
  Rootless test works regardless of kernel).

- podman generate systemd tests: always use --files option,
  because otherwise the "DEPRECATED" warning gets written
  to the systemd unit file.

- kube play tests: yikes. Fix longstanding bugs when checking
  for containers running. This revealed a longstanding bug
  in one test: multi-pod YAML never actually worked. Fixed now.

- run_podman(): that new check-for-warnings code we added
  in #19878, duh, I skipped it on Debian but should've skipped
  when *runc*. Do so now and update the comment. Requires
  minor surgery to podman_runtime() helper to avoid
  infinite recursion.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-09 09:30:15 -07:00
Alex Jia 260f814bd3 test/system: add test for mounting issue in the init container
Test coverage: https://issues.redhat.com/browse/RHEL-14469

Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2024-01-05 09:57:12 +08:00
Ed Santiago 8c546cf7ee CI: bump VMs
All VMs have pasta 2023-12-04, so, remove a skip.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-02 16:10:35 -07:00
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
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
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] a52f75e20b
Merge pull request #20938 from edsantiago/new_vms
CI: unskip tests on new VMs
2023-12-13 10:32:30 +00: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 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
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 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 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