Commit Graph

6094 Commits

Author SHA1 Message Date
openshift-merge-bot[bot] 9bf3cf6584
Merge pull request #21611 from giuseppe/correctly-chown-to-existing-dir-in-userns
libpod: correctly map UID/GID for existing dirs
2024-02-13 02:48:26 +00:00
openshift-merge-bot[bot] 007ccee9e2
Merge pull request #21618 from edsantiago/vms-with-netavark-10-3
Bump CI VMs to ones with netavark 1.10.3
2024-02-13 02:42:56 +00:00
Giuseppe Scrivano c29fde2656
libpod: correctly map UID/GID for existing dirs
if the target mount path already exists and the container uses a user
namespace, correctly map the target UID/GID to the host values before
attempting a chown.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-02-12 23:04:24 +01:00
openshift-merge-bot[bot] 01bd79b371
Merge pull request #21523 from umohnani8/memory-final
Use persist dir for oom file
2024-02-12 21:38:43 +00:00
Ed Santiago 5eb801a562 Bump CI VMs to ones with netavark 1.10.3
And, runc-1.12 broke our seccomp e2e tests (runc now calls getcwd(),
which is the dummy syscall blocked for testing seccomp). Switch
to blocking link() instead.

Also, disable v4.1.0 upgrade tests. They're hanging, and I have
no idea why, and have wasted most of a day debugging.

Fixes: #21546

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-12 13:55:03 -07:00
Urvashi Mohnani 667311c7d5 Use persist dir for oom file
Conmon writes the exit file and oom file (if container
was oom killed) to the persist directory. This directory
is retained across reboots as well.
Update podman to create a persist-dir/ctr-id for the exit
and oom files for each container to be written to. The oom
state of container is set after reading the files
from the persist-dir/ctr-id directory.
The exit code still continues to read the exit file from
the exits directory.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-02-12 09:13:39 -05:00
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] 5311233f86
Merge pull request #21556 from ygalblum/quadlet-comment-line
Quadlet - do not look for line continuation in comment lines
2024-02-08 19:54:38 +00:00
openshift-merge-bot[bot] 4570ccb95d
Merge pull request #21535 from edsantiago/upgrade_tests
Upgrade tests: reenable, but revamped
2024-02-08 17:26:11 +00:00
openshift-merge-bot[bot] 88b994902d
Merge pull request #21512 from Luap99/pasta-netname-removal
drop support for "pasta" as a network name
2024-02-08 17:17:55 +00:00
Matt Heon 72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
openshift-merge-bot[bot] 4fc52ed068
Merge pull request #21534 from mheon/stats_per_interface
Send container stats over API on a per-interface basis
2024-02-08 14:19:08 +00:00
openshift-merge-bot[bot] 246831b50f
Merge pull request #21409 from rhatdan/events
Show network name network events with podman -remote events
2024-02-08 14:16:24 +00:00
openshift-merge-bot[bot] 9ad07d10b9
Merge pull request #21446 from vikas-goel/network
Set interface name to the network_interface name for macvlan and ipvlan networks
2024-02-08 13:32:41 +00:00
Ed Santiago e20b70c2e6 Upgrade tests: reenable, but revamped
No longer bother testing any 2.x or 3.x. Only 4.1 and above.

Remove all CNI-related code. CNI is gone.

Add DatabaseBackend tests, confirming that we can handle
both boltdb and sqlite.

Require BATS >= 1.8.0, and use "run -0" to do exit-status checks.

Update docs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-08 06:22:56 -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
Ygal Blum d47979761f Quadlet - do not look for line continuation in comment lines
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-02-08 13:03:33 +02: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
Vikas Goel a8b2256cc1 Set interface name to the network_interface name for macvlan and ipvlan networks
When interface_name attribute in containers.conf file is set to "device", then set interface names inside containers same as the network_interface names of the respective network.

The change applies to macvlan and ipvlan networks only. The interface_name attribute value has no impact on any other types of networks.

If the interface name is set in the user request, then that takes precedence.

Fixes: #21313

Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
2024-02-06 19:05:16 -08:00
Matt Heon 6e0decbe03 Send container stats over API on a per-interface basis
This mirrors how the Docker API handles things, allowing us to be
more compatible with Docker and more verbose on the Libpod API.
Stats are given as per network interface in the container, but
still aggregated for `podman stats` and `podman pod stats`
display (so the CLI does not change, only the Libpod and Compat
APIs).

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-06 17:05:07 -05:00
Daniel J Walsh c7910e75e3
Show network name network events with podman -remote events
Fixes: https://github.com/containers/podman/issues/21311

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-06 15:43:05 -05:00
openshift-merge-bot[bot] 22b1650619
Merge pull request #21530 from Luap99/netavark-skip
test/e2e: unskip netavark macvlan/ipvlan tests
2024-02-06 19:21:05 +00:00
Paul Holzinger a997d7d819
test/e2e: unskip netavark macvlan/ipvlan tests
These should all work with the latest netavark. The ipvlan case needs a
subnet because it does not support DHCP.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-06 15:49:34 +01:00
openshift-merge-bot[bot] 75e6564138
Merge pull request #21497 from vikas-goel/volsfrom
Use semi-colon as the field separator for internal volumes-from inspect annotation
2024-02-06 14:35:34 +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
Paul Holzinger 249474a84e
drop support for "pasta" as a network name
The pasta network mode has been added in podman v4.4 and this causes a
conflict with named networks that could also be called "pasta". To not
break anything we had special logic to prefer the named network over the
network mode. Now with 5.0 we can break this and remove this awkward
special handling from the code.

Containers created with 4.X that use a named network pasta will also
continue to work fine, this chnage will only effect the creation of new
containers with a named network pasta and instead always used the
network mode pasta. We now also block the creation of networks with the
name "pasta".

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-05 13:57:24 +01:00
Vikas Goel a098899104 Use semi-colon as the field separator for internal volumes-from inspect annotation
The current field separator comma of the inspect annotation conflicts with the mount options of --volumes-from as the mount options itself can be comma separated.

Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
2024-02-05 00:16:53 -08:00
openshift-merge-bot[bot] 11c37d5c95
Merge pull request #21272 from rhatdan/VENDOR
Add tests to make sure mounts.conf does not warn on missing content
2024-02-02 16:03:39 +00:00
openshift-merge-bot[bot] 5e64d4f021
Merge pull request #21068 from alexlarsson/quadlet-templates
Support templates in quadlet
2024-02-02 10:36:18 +00: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
openshift-merge-bot[bot] 7cb0c2ef09
Merge pull request #21000 from rhatdan/machine
Strip key/values of external quotes
2024-02-02 00:59:03 +00:00
openshift-merge-bot[bot] d8c58936a4
Merge pull request #21414 from umohnani8/farm-reg
Farm build should read server registries.conf
2024-02-01 19:37:17 +00:00
Ed Santiago 1ab55defbb Test new CI VMs
From https://github.com/containers/automation_images/pull/325

Major change: netavark and aardvark are now included in prior-fedora,
so CNI can be fully eliminated from CI (#21410)

FIXME FIXME FIXME: skip two e2e tests, waiting for new netavark

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-02-01 09:50:41 -07:00
openshift-merge-bot[bot] f7afaf9652
Merge pull request #21455 from vrothberg/resolve-endpoint
add new libpod/images/$name/resolve endpoint
2024-01-31 21:06:57 +00:00
Urvashi Mohnani a06685a548 Farm build should read server registries.conf
Fix the way we set skipTLSVerify on the client side
to ensure that the push stage in farm build takes into
account the configuration in the farm node's registries.conf
when the user hasn't set it on the client side.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2024-01-31 15:41:27 -05:00
Valentin Rothberg b028f6aa75 add new libpod/images/$name/resolve endpoint
Podman Desktop [1] is looking into improving the user experience which
requires to know the source of an image.  Consider the user triggers an
image pull and Podman Desktop wants to figure out whether the image name
refers to a Red Hat registry, for instance, to prompt installing the RH
auth extension.

Since the input values of images may be a short name [2], Podman Desktop
has no means to figure out the (potential) source of the image.  Hence,
add a new `/resolve` endpoint to allow external callers to figure out
the (potential) fully-qualified image name of a given value.

With the new endpoint, Podman Desktop can ask Podman directly to resolve
the image name and then make an informed decision whether to prompt the
user to perform certain tasks or not.  This for sure can also be used
for any other registry (e.g., Quay, Docker Hub).

[1] https://github.com/containers/podman-desktop/issues/5771
[2] https://www.redhat.com/sysadmin/container-image-short-names

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2024-01-31 16:20:16 +01: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
openshift-merge-bot[bot] 1698fa0ad8
Merge pull request #21388 from ashley-cui/healthcheck
Return nil health when inspecting containers without healthchecks
2024-01-31 13:48:36 +00:00
Ashley Cui a1c47f0299 Return nil health when inspecting containers without healthchecks
When inspecting a container that does not define any health check, the health field should return nil. This matches docker behavior.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-01-30 23:09:13 -05:00
openshift-merge-bot[bot] dabbcb8386
Merge pull request #21339 from mheon/specgen_to_pointer_v2
Convert SpecGen values to be nullable where possible
2024-01-30 19:06:14 +00: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] c41c30bedd
Merge pull request #21180 from rhatdan/nvidia
Make --gpus work with nvidia gpus
2024-01-30 14:59:02 +00: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
openshift-merge-bot[bot] d7bf1385d8
Merge pull request #21260 from umohnani8/img-filters
Fix image filters parsing
2024-01-28 12:39:55 +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