Commit graph

15944 commits

Author SHA1 Message Date
Kir Kolyshkin
910bf6bfbe CI: restore the consistency check
This is a partial revert of commit 47b995b10.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-03-06 19:34:07 -08:00
Kir Kolyshkin
1135947b28 Use a branched runc instead of manual vendor changes
Commit 3e7ca842a manually patched runc/libcontainer in vendor, which is
OK but creates a maintenance problem down the line.

Instead, let's
 - create a branch[1] based on runc commit used here;
 - backport the CVE-2024-21626 fixes;
 - vendor the above branch here.

As a side note, all this mess could have been avoided if
https://github.com/opencontainers/runc/pull/3508 was backported
to a stable runc branch. Alas, this was never requested.

[1] https://github.com/projectatomic/runc/tree/podman-v4.2.0-rhel

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-03-06 19:33:45 -08:00
openshift-merge-bot[bot]
98fc8c62d3
Merge pull request #21483 from mheon/runc_manual_patch_420rhel
[v4.2.0-rhel] Manually patch vendor/ to address CVE-2024-21626
2024-02-02 21:33:31 +00:00
Matt Heon
52aa483090 Disable compose test as well, it uses python
Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 14:01:55 -05:00
Ed Santiago
f3355f9591 (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>

<MH: Cherry-pick into v4.2.0-rhel to fix CI>

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 13:45:52 -05:00
Matt Heon
47b995b102 Disable broken CI tasks
Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 13:45:52 -05:00
Matt Heon
3e7ca842a6 Manually patch vendor/ to address CVE-2024-21626
We can't bump runc in this branch, it brings in too many other
things that won't build on this old Golang (this branch is still
on v1.16).

So, instead, backport the runc patches to this older runc.

The good news: We vendor very little of runc, so this was not all
that difficult.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-02 10:22:59 -05:00
OpenShift Merge Robot
22cf8c296d
Merge pull request #18832 from TomSweeneyRedHat/dev/tsweeney/tpyo_v4_2_0-rhel
[v4.2.0-rhel] podman-kube@.service.in: Remove Restart=never option wi…
2023-06-10 06:44:36 -04:00
Andrew Gunnerson
a5aa524ca7 [v4.2.0-rhel] podman-kube@.service.in: Remove Restart=never option with typo
systemd expects the value of the option to be `no` instead, but this is
already the default behavior. This fixes the following warning when
running `systemctl status` on the unit:

    Failed to parse service restart specifier, ignoring: never

Addresses: https://issues.redhat.com/browse/OCPBUGS-14284

[NO NEW TESTS NEEDED]

Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
2023-06-08 18:16:56 -04:00
OpenShift Merge Robot
1a116d108e
Merge pull request #17315 from TomSweeneyRedHat/dev/tsweeney/randomfix_4.2
[v4.2.0-rhel] all: stop using deprecated GenerateNonCryptoID
2023-02-02 13:31:24 +01:00
Kir Kolyshkin
f19c0335c2 [v4.2.0-rhel] all: stop using deprecated GenerateNonCryptoID
Cherry-pick #15788 to v4.2.0-rhel branch per RHBZ 2157930

In view of https://github.com/containers/storage/pull/1337, do this:

	for f in $(git grep -l stringid.GenerateNonCryptoID | grep -v '^vendor/'); do
		sed -i 's/stringid.GenerateNonCryptoID/stringid.GenerateRandomID/g' $f;
	done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-02-01 16:35:50 -05:00
OpenShift Merge Robot
e1f0d65296
Merge pull request #17079 from cevich/v4.2.0-rhel_rm_gitlab
[v4.2.0-rhel] Cirrus: Strip only-main CI tasks
2023-01-11 13:24:12 -05:00
Chris Evich
159c79b50e
Cirrus: Strip only-main CI tasks
Signed-off-by: Chris Evich <cevich@redhat.com>
2023-01-11 10:47:00 -05:00
Daniel J Walsh
b8b9f57aae
Merge pull request #17008 from Romain-Geissler-1A/backport-docker-client-build-compat-v4.2.0-rhel
[release-v4.2.0-rhel] compat,build: handle docker's preconfigured cacheTo,cacheFrom
2023-01-10 13:01:35 -05:00
Daniel J Walsh
28df097800
Merge pull request #17052 from giuseppe/v4.2.0-rhel-podman-rm-f-no-processes
[v4.2.0-rhel] podman: podman rm -f doesn't leave processes
2023-01-10 10:29:30 -05:00
Giuseppe Scrivano
dce4a44c6f
podman: podman rm -f doesn't leave processes
follow-up to 6886e80b45

when "podman -rm -f" is used on a container in "stopping" state, also
make sure it is terminated before removing it from the local storage.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 4cf06fe7e0)
2023-01-10 11:18:37 +01:00
Giuseppe Scrivano
a83a88ec92
oci: check for valid PID before kill(pid, 0)
check that the container has a valid pid before attempting to use
kill($PID, 0) on it.  If the PID==0, it means the container is already
stopped.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 494db3e166)
2023-01-10 11:18:36 +01:00
Aditya R
75b236a2b4 compat,build: handle docker's preconfigured cacheTo,cacheFrom
Docker's newer clients popuates `cacheFrom` and `cacheTo` parameter
by default as empty array for all commands but buildah's design of
distributed cache expects this to be a repo not image hence parse
only the first populated repo and igore if empty array.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-05 22:44:01 +00:00
OpenShift Merge Robot
0608f55e91
Merge pull request #17010 from openshift-cherrypick-robot/cherry-pick-16577-to-v4.2.0-rhel
[v4.2.0-rhel] [CI:DOCS] Migrate OSX Cross to M1
2023-01-05 10:43:59 -05:00
Ashley Cui
a598b73105 Migrate OSX Cross to M1
Migrate our OSX Cross build to a M1 instance, since Cirrus is sunsetting Intel-based macOS instances.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-05 14:40:25 +00:00
Daniel J Walsh
9ad538922d
Merge pull request #16990 from giuseppe/v4.2.0-rhel-backport-fix-race-condition-rm-ing-stopping-containers
[v4.2.0] libpod: fix race condition rm'ing stopping containers
2023-01-04 11:56:06 -05:00
Giuseppe Scrivano
cbe15ef706
libpod: fix race condition rm'ing stopping containers
do not allow removing containers that are in the stopping state,
otherwise it can lead to a race condition where a "podman rm" removes
the container from the storage while another process is stopping the
same container.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2155828

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 6886e80b45)
2023-01-04 13:27:21 +01:00
Daniel J Walsh
43f4a866b9
Merge pull request #16935 from giuseppe/podman-4.2.0-rhel-bump-storage
[4.2.0-rhel] vendor: bump containers/storage
2022-12-26 07:27:53 -05:00
Giuseppe Scrivano
a4e0784651
vendor: bump containers/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-12-23 20:22:26 +01:00
Daniel J Walsh
ff97c90f2c
Merge pull request #16866 from giuseppe/v4.2.0-rhel-no-spawn-dbus
[v4.2.0-rhel] vendor: bump to c/common v0.49.3
2022-12-17 05:11:15 -05:00
Giuseppe Scrivano
097aba1a53
vendor: bump to c/common v0.49.3
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-12-16 15:09:24 +01:00
OpenShift Merge Robot
bfac4a5de2
Merge pull request #16802 from TomSweeneyRedHat/dev/tsweeney/buildah_1.27.3
[v4.2-rhel] Bump Buildah to v1.27.3
2022-12-10 06:07:06 -05:00
tomsweeneyredhat
0f8ba63f04 [v4.2-rhel] Bump Buildah to v1.27.3
Bump Buildah to v1.27.3 which itself bumps opencontainers/selinux to
1.10.2, has fixes for the sticky bit, allows containers to be
restarted in a pod when they should be, a fix for a RHEL subscription issue,
 and s390x segv issues across RHEL 8.7 and 9.1 Zstreams

Addresses:
https://bugzilla.redhat.com/show_bug.cgi?id=2150416
https://bugzilla.redhat.com/show_bug.cgi?id=2150428
https://bugzilla.redhat.com/show_bug.cgi?id=2137294
https://bugzilla.redhat.com/show_bug.cgi?id=2149775
https://bugzilla.redhat.com/show_bug.cgi?id=2152027
https://bugzilla.redhat.com/show_bug.cgi?id=2152017
https://bugzilla.redhat.com/show_bug.cgi?id=2150433
https://bugzilla.redhat.com/show_bug.cgi?id=2150432
https://bugzilla.redhat.com/show_bug.cgi?id=2136928
https://bugzilla.redhat.com/show_bug.cgi?id=2149776
https://bugzilla.redhat.com/show_bug.cgi?id=2152026
https://bugzilla.redhat.com/show_bug.cgi?id=2152022
https://bugzilla.redhat.com/show_bug.cgi?id=2152042
https://bugzilla.redhat.com/show_bug.cgi?id=2152043

[NO NEW TESTS NEEDED]
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-12-09 19:58:50 -05:00
Daniel J Walsh
674283809a
Merge pull request #16646 from vrothberg/v4.2-BZ-2144754
[v4.2.0-rhel] container restart: clean up healthcheck state
2022-11-28 13:59:43 -05:00
Valentin Rothberg
c7ea09bbb6 fix search flake
There's no guarantee that the searched image will be returned, so only
make sure that "alpine" is mentioned somewhere.

Fixes: #16248
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-28 13:53:49 +01:00
Daniel J Walsh
3ca8271d53 Fix search_test to return correct version of alpine
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-28 13:53:42 +01:00
Valentin Rothberg
525ef3e38d container restart: clean up healthcheck state
When restarting a container, clean up the healthcheck state by removing
the old log on disk.  Carrying over the old state can lead to various
issues, for instance, in a wrong failing streak and hence wrong
behaviour after the restart.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2144754
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-28 12:55:58 +01:00
OpenShift Merge Robot
2f3d14823a
Merge pull request #16429 from edsantiago/fix_ubi8_b0rkage_v420rhel
[v4.2.0-rhel] FIXME: Temporary workaround for ubi8 CI breakage
2022-11-07 09:44:50 -05:00
Daniel J Walsh
3dd6c0f478
Merge pull request #16251 from TomSweeneyRedHat/dev/tsweeney/100ms
[v4.2.0-rhel] libpod: Remove 100msec delay during shutdown
2022-11-07 07:37:56 -05:00
Ed Santiago
7023e4bfa1 FIXME: Temporary workaround for ubi8 CI breakage
Emergency import of https://github.com/containers/buildah/pull/4377
required because the ubi8 image changed behind our backs.

On podman main, this commit will be reverted by Ed's
treadmill as soon as a new buildah is vendored into podman.

On side branches, the human doing the vendoring will need to
perform manual surgery. I hope the instructions are good enough.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-11-07 05:36:19 -07:00
Daniel J Walsh
3fbf30e6a6
Merge pull request #16416 from mheon/bump_cs
[v4.2.0-rhel] Bump c/storage to include #1423
2022-11-04 15:41:52 -04:00
Matthew Heon
45fb29067b Bump c/storage to include #1423
There was a bug on s390x related to clone syscall argument order.
C/storage PR #1423 fixes it; this vendors into Podman to close
the loop and complete the fix.

Fixes RHBZ 2140084

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-11-04 13:46:14 -04:00
Brent Baude
35c0df38e7
Merge pull request #16295 from mtrmac/backport-trust-again
[v4.2.0-rhel] podman image trust overhaul, incl. sigstore
2022-10-26 12:33:13 -05:00
Miloslav Trmač
02ac1c0a8f Preserve all unknown PolicyRequirement fields on (podman image trust set)
We are unmarshaling and re-marshaling JSON, which can _silently_ drop data
with the Go design decision.data.

Try harder, by using json.RawMessage at least for the data we care about.

Alternatively, this could use json.Decoder.DisallowUnknownFields.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:38 +02:00
Miloslav Trmač
5395fc7ce2 Reorganize the types in policy.go a bit
... to go from top to bottom.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:38 +02:00
Miloslav Trmač
ed3a129acf Add support for showing keyPaths in (podman image trust show)
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
dcbaf5e71b Support (image trust show) for sigstoreSigned entries
sigstoreSigned does not have GPG IDs, so we add N/A in that column.

NOTE: this does not show the use-sigstore-attachments value from
registries.d.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
80db448526 BREAKING CHANGE: Change how (podman image trust show) represents multiple requirements
Currently
- the output uses the first entry's type, even if the requirements are different
  (notably signedBy + sigstoreSIgned)
- all public keys IDs are collected to a single line, even if some of them
  are interchangeable, and some are required (e.g. two signedBy requirements
  could require an image to be signed by (redhatProd OR redhatBeta) AND (vendor1 OR vendor2)

So, stop collapsing the requirements, and return a separate entry for each one. Multiple
GPG IDs on a single line used to mean AND or OR, now they always mean AND.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
d5f34eac7b Reorganize descriptionsOfPolicyRequirements a bit
Do the registries.d lookup once, separately from building
an entry, so that we can share it across entries.

Also prepare a separate res to allow adding multiple entries.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
9bda9a6c6d Use the full descriptionsOfPolicyRequirements for the default scope
... instead of taking a shortcut, e.g. not listing any keys if they are required.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
4aefe63718 Rename haveMatchRegistry to registriesDConfigurationForScope
Just so that we don't have a boolean-named function returning a struct.
Also reorder the parameters to have the container first, and the lookup
key second.

Shoud not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
a685c89f9c Rename tempTrustShowOutput to entry
Now that it is the primary return value of a small function,
the long name only makes reading harder.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
4c1620a651 Split descriptionsOfPolicyRequirements out of getPolicyShowOutput
This will evetually allow us to use it for the default scope
as well, which currently uses a simplified version.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
cccb024d3e Recognize the new lookaside names for simple signing sigstore
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00
Miloslav Trmač
f18066195d Add a unit test for trust.PolicyDescription
Add at least a basic unit test for the various entry types.

So that we don't have to actually deal with GPG keys and /usr/bin/gpg*,
parametrize the code with a gpgIDReader , and pass a fake one
in the unit test.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-25 23:31:37 +02:00