Commit Graph

24046 Commits

Author SHA1 Message Date
Miloslav Trmač fdc9feea0e Fix 330-corrupt-images.bats in composefs test runs
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-10-18 23:44:04 +02:00
openshift-merge-bot[bot] 290d94d3c0
Merge pull request #24300 from edsantiago/flake-fix-checkpoint-test
CI: e2e: fix checkpoint flake
2024-10-18 16:42:44 +00:00
openshift-merge-bot[bot] d3df5c5994
Merge pull request #24305 from Luap99/quadlet-pasta
quadlet: make user units wait for network
2024-10-18 15:55:59 +00:00
Paul Holzinger 67e0fa8b89
quadlet: add default network dependencies to all units
There is no good reason for the special case, kube and pod units
definitely need it. Volume and network units maybe not but for
consistency we add it there as well. This makes the docs much easier to
write and understand for users as the behavior will not differ.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 14:01:22 +02:00
Paul Holzinger 57b022782b
quadlet: ensure user units wait for the network
As documented in the issue there is no way to wait for system units from
the user session[1]. This causes problems for rootless quadlet units as
they might be started before the network is fully up. TWhile this was
always the case and thus was never really noticed the main thing that
trigger a bunch of errors was the switch to pasta.

Pasta requires the network to be fully up in order to correctly select
the right "template" interface based on the routes. If it cannot find a
suitable interface it just fails and we cannot start the container
understandingly leading to a lot of frustration from users.

As there is no sign of any movement on the systemd issue we work around
here by using our own user unit that check if the system session
network-online.target it ready.

Now for testing it is a bit complicated. While we do now correctly test
the root and rootless generator since commit ada75c0bb8 the resulting
Wants/After= lines differ between them and there is no logic in the
testfiles themself to say if root/rootless to match specifics. One idea
was to use `assert-key-is-rootless/root` but that seemed like more
duplication for little reason so use a regex and allow both to make it
pass always. To still have some test coverage add a check in the system
test to ask systemd if we did indeed have the right depdendencies where
we can check for exact root/rootless name match.

[1] https://github.com/systemd/systemd/issues/3312

Fixes #22197

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 11:43:48 +02:00
Paul Holzinger 203ab6573b
add new podman-user-wait-network-online.service
This service is meant to be used by quadlet as replacement for
network-online.target as this does not work for rootless users.

see #22197

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 11:43:45 +02:00
Paul Holzinger a6c4e00e9a
contrib/systemd: switch user symlink for file symlinks
The reason being that I plan to add a unit that should only be used for
the user session and otherwise there is no way to only keep a unit in
user.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 11:40:45 +02:00
Paul Holzinger 1462b52090
Makefile: remove some duplication from install.systemd
Use a single loop for both the user and system service so we do not have
to duplicate the full paths every time.
In particular we can use `$^` to list all dependecies and then add the
not generated files to the loop as well to simplify this. And to make
things clear rename PODMAN_UNIT_FILES to PODMAN_GENERATED_UNIT_FILES so
readers immediately know they are generated and are safe to delete in
contrast to the .socket/.timer unit that are not and part of the git
history.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-18 11:37:58 +02:00
Paul Holzinger 21d0711a02
contrib/systemd: move podman-auto-update units
There is really no reason why these should be in separate dir.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-17 17:48:28 +02:00
openshift-merge-bot[bot] 740f1d1fc7
Merge pull request #24306 from Luap99/quadlet-root-test
quadlet: do not reject RemapUsers=keep-id as root
2024-10-17 14:27:07 +00:00
Paul Holzinger 9c6b1e20a3
quadlet: do not reject RemapUsers=keep-id as root
This is simply wrong, as of commit de63ad7044 --userns=keep-id is also
allowed as root.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-17 15:53:10 +02:00
Paul Holzinger ada75c0bb8
test/e2e: test quadlet with and without --user
This seems to be a testing gap, we need to test both for full coverage.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-17 15:53:10 +02:00
Ed Santiago fa920f54c7 CI: e2e: fix checkpoint flake
Two flakes seen in the last three months. One of them was in
August, so it's not related to ongoing criu-4.0 problems.

Suspected cause: race waiting for "podman run --rm" container
to transition from stopped to removed.

Solution: allow a 5-second grace period, retrying every second.

Also: add explanations to the Expect()s, remove unnecessary
code, and tighten up the CID check.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-17 06:40:33 -06:00
openshift-merge-bot[bot] 993ecd5a05
Merge pull request #24261 from mheon/update_contributing
Thorough overhaul of CONTRIBUTING doc.
2024-10-17 11:03:36 +00:00
openshift-merge-bot[bot] 7d5377bb2e
Merge pull request #24238 from edsantiago/pasta-bytecheck
pasta udp tests: new bytecheck helper
2024-10-17 09:19:05 +00:00
Ed Santiago fe96c843bf APIv2 test fix: image history
I'm assuming this was buildah#5595: the COMMENT field moved around.
Deal with it, and add a few more checks while we're at it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
Ed Santiago 67e39c1ec5 pasta udp tests: new bytecheck helper
...for debugging #24147, because "md5sum mismatch" is not
the best way to troubleshoot bytestream differences.

socat is run on the container, so this requires building a
new testimage (20241011). Bump to new CI VMs[1] which include it.

 [1] https://github.com/containers/automation_images/pull/389

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 10:15:19 -06:00
Ed Santiago a92958eb0c Document packaging process
High-level overview of packaging, intended for Linux distros.

Closes: RUN-1356

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 09:52:35 -06:00
openshift-merge-bot[bot] b65f3b19a5
Merge pull request #24295 from lsm5/rpm-spec-cleanup
[skip-ci] RPM: remove dup Provides
2024-10-16 14:27:59 +00:00
openshift-merge-bot[bot] ac5cbcb031
Merge pull request #24294 from containers/renovate/setuptools-75.x
Update dependency setuptools to ~=75.2.0
2024-10-16 14:11:23 +00:00
Lokesh Mandvekar cf124ee1bb
[skip-ci] RPM: remove dup Provides
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2024-10-16 19:37:13 +05:30
renovate[bot] 927cb7624c
Update dependency setuptools to ~=75.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 13:48:10 +00:00
openshift-merge-bot[bot] 12c03ed6fe
Merge pull request #24291 from edsantiago/bats-safer-mypod
System tests: safer pause-image creation
2024-10-16 13:46:31 +00:00
Ed Santiago 1ddb15c81f System tests: safer pause-image creation
The current mypod hack breaks down when running individual tests:

    $ hack/bats 010   <<< barfs because it does not want pause-image!

Reason: Bats does not provide any official way to tell if tests
are being run in parallel.

Workaround: use an undocumented way.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-16 06:02:23 -06:00
openshift-merge-bot[bot] 27d73b0cd0
Merge pull request #24289 from ThaddeusTreloar/fix/hyperv-powershell-path-sanitise
Added escaping to invoked powershell command for hyperv stubber.
2024-10-16 10:26:21 +00:00
openshift-merge-bot[bot] d7e0933030
Merge pull request #24288 from containers/renovate/github.com-opencontainers-selinux-1.x
Update module github.com/opencontainers/selinux to v1.11.1
2024-10-16 08:42:32 +00:00
openshift-merge-bot[bot] bd1abf05bb
Merge pull request #24284 from zackattackz/slices-clone
use slices.Clone instead of assignment
2024-10-16 07:14:34 +00:00
renovate[bot] 40d4f7240b
Update module github.com/opencontainers/selinux to v1.11.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 02:44:20 +00:00
ThaddeusTreloar 1227f19393 Added escaping to invoked powershell command for hyperv stubber.
Signed-off-by: ThaddeusTreloar <thaddeus.treloar@protonmail.com>
2024-10-16 13:16:39 +11:00
openshift-merge-bot[bot] a2eb5429b3
Merge pull request #24264 from edsantiago/try-try-again
CI: fix changing-rootFsSize flake
2024-10-15 22:05:42 +00:00
openshift-merge-bot[bot] d5be88e0c2
Merge pull request #24228 from giuseppe/do-not-lower-rlimits
podman: do not set rlimits to the default value
2024-10-15 22:02:52 +00:00
openshift-merge-bot[bot] a38eaa5b31
Merge pull request #24240 from zackattackz/scp-opts
scp: add option types
2024-10-15 21:54:38 +00:00
Zachary Hanham b7b2ef48e8 use slices.Clone instead of assignment
Fixes #24267

This commit replaces a potentially unsafe slice-assignment with a call to `slices.Clone`.

This could prevent a bug where `saveCommand` and `loadCommand` could end up sharing an underlying array if `parentFlags` has a cap > it's len.

Signed-off-by: Zachary Hanham <z.hanham00@gmail.com>
2024-10-15 14:14:46 -04:00
openshift-merge-bot[bot] f668fd9f8d
Merge pull request #24279 from edsantiago/dedup-cirrus
Housekeeping: remove duplicates from success_task
2024-10-15 17:19:40 +00:00
openshift-merge-bot[bot] 40dae5edd3
Merge pull request #24242 from rhatdan/krunkit
Mention containers.conf settings for podman machine commands
2024-10-15 17:03:10 +00:00
Paul Holzinger 768aaadca1
libpod API: only return exit code without conditions
The special handling to return the exit code after the container has
been removed should only be done if there are no special conditions
requested. If a user asked for running or nay other state returning the
exit code immediately with a success response is just wrong. We only
want to allow that so the remote client can fetch the exit code without
races.

Fixes b3829a2932 ("libpod API: make wait endpoint better against rm races")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-15 18:31:36 +02:00
Ed Santiago b3302e8e18 Housekeeping: remove duplicates from success_task
Accidentally introduced in #21639.

Thanks to Paul for the Python code to prevent this from
happening again.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-15 10:09:15 -06:00
Matt Heon 1bf37eecf3 Thorough overhaul of CONTRIBUTING doc.
The doc has been reorganized and reordered. New sections have
been added as necessary to cover things not covered by the old
guide. Some sections were expanded (e.g. detailing differences
between E2E and System tests). Some sections that we did not
actually follow were removed.

Fixes https://issues.redhat.com/browse/RUN-2281

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-15 11:22:52 -04:00
openshift-merge-bot[bot] cc215483be
Merge pull request #24270 from inknos/update-ci-vm-images-f40f39d13
Test new VM build
2024-10-15 14:01:42 +00:00
Tigran Sogomonian c05987ddd3 api: Replace close function in condition body
The close is replaced in the body of the error condition.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>
2024-10-15 17:00:47 +03:00
openshift-merge-bot[bot] 1dcb4c58c2
Merge pull request #24274 from Luap99/fix-signal-exit
test/e2e: fix default signal exit code test
2024-10-15 13:47:53 +00:00
Paul Holzinger b0f2ebbe9d
test/e2e: fix default signal exit code test
By default golang programs exit 2 on special exit signals that can be
cought and produce a stack trace. However this is behavior that can be
modfied via GOTRACEBACK=crash[1], in that case it does not exit(2) but
rather sends itself SIGABRT to the parent sees the signal exit and out
test sees that es exit code 134, 128 + 6 (SIGABRT), like most shells do.

As it turns out GOTRACEBACK=crash is the default mode on all fedora and
RHEL rpm builds as they patch the build with a special
"rpm_crashtraceback" go build tag.

While that change is old and existing for a very long time it was never
caught until commit 5e240ab1f5, which switched the old ExitWithError()
check that accepted anything > 0, to just accept 2. And as CI only test
upstream builds that are build without rpm_crashtraceback we did not
catch in CI either. Only once a user actually used distro build against
the source e2e test it failed.

I like to highlight that running distro builds against upstream e2e
tests is not something we really support or plan to support but given
this is a easy fix I decided to just fix it here as any user with
GOTRACEBACK=crash set would face the same issue.

While I touch this test remove the unnecessary RestoreArtifact() call
which is not needed at all as we do nothing with the image and just
slows the test down for now reason.

[1] https://pkg.go.dev/runtime#section-sourcefiles

Fixes #24213

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-10-15 15:17:50 +02:00
Nicola Sella dc55b59987 Test new VM build
https://github.com/containers/automation_images/pull/376

Signed-off-by: Nicola Sella <nsella@redhat.com>
2024-10-15 13:26:30 +02:00
Ed Santiago 1b57dcab61 CI: fix changing-rootFsSize flake
(Second try). Use an airgapped image in the inspect-data tests.

Fixes: #23756

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-10-15 05:14:49 -06:00
Zachary Hanham feb46513f0 scp: add option types
Prior to this commit, many scp functions existed without option structs, which would make extending functionality (adding new options) impossible without breaking changes, or without adding redundant wrapper functions.

This commit adds in new option types for various scp related functions, and changes those functions' signatures to use the new options.

This commit also modifies the `ImageEngine.Scp()` function's interface to use the new opts.

The commit also renames the existing `ImageScpOptions` entity type to `ScpTransferImageOptions`. This is because the previous `ImageScpOptions` was inaccurate, as it is not the actual options for `ImageEngine.Scp()`. `ImageEngine.Scp()` should instead receive `ImageScpOptions`.

This commit should not change any behavior, however it will break the existing functions' signatures.

Signed-off-by: Zachary Hanham <z.hanham00@gmail.com>
2024-10-14 21:46:55 -04:00
openshift-merge-bot[bot] 3fbae8e28e
Merge pull request #24259 from emakrushin/containers
Unlock mutex before returning from function
2024-10-14 21:09:26 +00:00
openshift-merge-bot[bot] 11ab0b7246
Merge pull request #24120 from Luap99/cirrus-build-speed
cirrus: use fastvm for builds
2024-10-14 16:04:12 +00:00
Егор Макрушин 06b470d79b Unlock mutex before returning from function
mapMutex is initialized in the ContainerRm function and cannot be released from outside,
thus unlock mutex before returning from function.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Егор Макрушин <emakrushin@astralinux.ru>
2024-10-14 18:22:42 +03:00
Matt Heon 7ea6120794 Note in the README that we are moving to timed releases
I'll also throw this on Podman.io and maybe write a short blog
about it there.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-10-14 18:22:42 +03:00
openshift-merge-bot[bot] 92666f2d70
Merge pull request #24257 from ericcurtin/CheckProcessRunning-debug
Make error messages more descriptive
2024-10-14 15:14:46 +00:00