Commit graph

15921 commits

Author SHA1 Message Date
Urvashi Mohnani
48a02aa1c0 Fix bind-mount-option annotation in gen/play kube
The format used for setting the bind-mount-options annotations
in the kube yaml was incorrect and caused k8s to throw an error
when trying to play the generated kube yaml.
Fix the annotation format to match the rules of k8s.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-09-06 15:05:50 -04:00
Arthur Sengileyev
7bb7908efa Improved Windows compatibility for machine command
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-09-06 15:03:42 -04:00
Jason Ertel
8634f55c75 updated apiv2 tests to reflect hash compat fix
Signed-off-by: Jason Ertel <jason.ertel@securityonionsolutions.com>
2022-09-06 14:55:22 -04:00
Josh Patterson
54a9e24488 api: return imageID instead of imageName, for "Image" when Podman API is queried
Signed-off-by: Josh Patterson <josh.patterson@securityonionsolutions.com>
2022-09-06 14:55:16 -04:00
Matthew Heon
ecfbc6f324 Inhibit SIGTERM during Conmon startup
If we get a SIGTERM immediately after Conmon starts but before we
record its PID in the database, we end up leaking a Conmon and
associated OCI runtime process. Inhibit shutdown using the logic
we originally wrote to prevent similar issues during container
creation to prevent this problem.

[NO NEW TESTS NEEDED] No real way to test this I can think of.

Fixes #15557

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-09-06 14:52:03 -04:00
patrycja-guzik
7f393811ae Fix example sections to follow the same format
Signed-off-by: patrycja-guzik <patrycja.k.guzik@gmail.com>
2022-09-06 14:48:05 -04:00
Stefano Figura
e3e8397dbc Fix template name inconsistency
Signed-off-by: Stefano Figura <stefano@figura.im>
2022-09-06 14:47:40 -04:00
Giuseppe Scrivano
fc5cd0e240 service: make move to sub-cgroup non fatal
if we are running in a container in the root cgroup, Podman tries to
move itself to a sub-cgroup.  This could be a problem in a setup where
the cgroups are not writeable, so just log a debug message and
continue, since anyway it is a best-effort operation.

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

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-06 14:45:30 -04:00
Urvashi Mohnani
d4b62e322b Remove duplicate annotations in generated service yaml
Don't add the same annotations as the pod yaml to the
service yaml as it is not needed.

[NO NEW TESTS NEEDED]

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-09-06 14:29:16 -04:00
Matthew Heon
063f332416 Compat API image remove events now have 'delete' status
Change only the compat API, so we don't force a breaking change
on Libpod API users.

Partial fix for #15485

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-09-06 14:28:59 -04:00
Ashley Cui
2aa71bf29a [CI:DOCS] Automatically set podman version in pkginstaller
Allow the pkginstaller makefile target to take advantage of Podman's version binary, alleviating the need to manually set Podman's version (and inevitably forgetting to do so). This means the pkginstaller Makefile will automatically detect what version of Podman we're packaging.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-09-06 14:26:51 -04:00
Brent Baude
931ccdcaa5 Allow colons in windows file paths
the `podman save` command was failing on windows due to the use of a
colon between the drive letter and first directory.  the check was
intended for Linux and not windows.

Fixes #15247

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-09-06 14:25:19 -04:00
Arthur Sengileyev
64fe541a62 Fixes isRootfull check using qemu machine on Windows
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-09-06 14:24:32 -04:00
Valentin Rothberg
b103f05794 vendor containers/psgo@v1.7.3
Add three new capabilities that would otherwise be reported as unknown.

Also add an e2e test making sure that `podman top` knows all
capabilities of the current kernel.  I refrained from adding a system
test since this may blow up in gating tests.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-09-06 14:24:10 -04:00
Daniel J Walsh
455a363bf1 Allow podman to run in an environment with keys containing spaces
Fixes: https://github.com/containers/podman/issues/15251

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-06 14:17:01 -04:00
Tomas Volf
d40175e0ae Document restrictions on transport in FROM
When using remote podman client, not all transports work as expected. So
document this limitation.

Fixes: containers/podman#15141
Signed-off-by: Tomas Volf <tomas.volf@showmax.com>
2022-09-06 14:13:19 -04:00
Arthur Sengileyev
ee9d3fd021 Improved Windows compatibility
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-09-06 14:12:53 -04:00
Charlie Doern
9d8c17ec08 pass environment variables to container clone
the env vars are held in the spec rather than the config, so they need to be mapped manually. They are also of a different format so special handling needed to be added. All env from the parent container will now be passed to the clone.

resolves #15242

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-09-06 14:05:37 -04:00
Hoang Thanh VO
0ab8ebd1a8 podman save: update --compress validation
[NO NEW TESTS NEEDED]

Signed-off-by: Hoang Thanh VO <111461555+ht-vo@users.noreply.github.com>
2022-09-06 14:01:59 -04:00
Josh Patterson
45672c61d7 sort hc.Binds returned from compat api
Signed-off-by: Josh Patterson <josh.patterson@securityonionsolutions.com>
2022-09-06 13:55:57 -04:00
Chris Evich
7c68167f60 Cirrus: Update podman-machine comment
Replace TODO comment with helpful hint for future maintainers.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-09-06 13:51:55 -04:00
Daniel J Walsh
f7b32321b5 podman images and friends can take one image as argument
Fixes: https://github.com/containers/podman/issues/15309

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-06 13:51:19 -04:00
Ashley Cui
5c150d7f24 [CI:DOCS] Add .DS_Store to gitignore
Ignore .DS_Store, a MacOS metadata file created by the OS.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-09-06 13:50:56 -04:00
Andrew Gunnerson
e5748015e6 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

Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
2022-09-06 13:49:36 -04:00
OpenShift Merge Robot
badbe62081
Merge pull request #15554 from openshift-cherrypick-robot/cherry-pick-15516-to-v4.2
[v4.2] Handle an already connected network in libpod API
2022-08-31 08:54:38 -04:00
OpenShift Merge Robot
42f6094d6e
Merge pull request #15539 from cevich/ec2_imgts
[v4.2] [CI:DOCS] Cirrus: Update meta task for EC2
2022-08-31 08:37:36 -04:00
Alessandro Rossi
3439657f91 Fix #15499 already connected network
Compat: Treat already attached networks as a no-op
Applies only to containers in created state. Maintain error in running state.

Co-authored-by: Alessandro Rossi <al.rossi87@gmail.com>
Co-authored-by: Brent Baude <bbaude@redhat.com>
Co-authored-by: Jason T. Greene <jason.greene@redhat.com>
Signed-off-by: Alessandro Rossi <al.rossi87@gmail.com>
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-08-30 19:25:00 +00:00
Lokesh Mandvekar
c5e47c0ac8
[CI:DOCS] Cirrus: Update meta-task for EC2 image
Copied from: https://github.com/containers/aardvark-dns/pull/207

Fixes: #15502

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-08-30 12:55:43 -04:00
OpenShift Merge Robot
b401ac2a75
Merge pull request #15533 from mtrmac/trust-4.2
podman image trust overhaul, incl. sigstore
2022-08-30 11:00:30 -04:00
OpenShift Merge Robot
01c7669115
Merge pull request #15521 from vrothberg/v4.2-fix-15492
[v4.2] libpod: UpdateContainerStatus: do not wait for container
2022-08-30 09:35:51 -04:00
Valentin Rothberg
8ed9354f4c fix CI: remove hardcodeded alpine version
The apiv2 test hardcoded the tag of the alpine image.
Remove it to unblock CI.

Fixes: #15388
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-08-30 13:24:12 +02:00
Valentin Rothberg
68ebf13d48 fix CI: remove hardcodeded alpine version
The apiv2 test hardcoded the tag of the alpine image.
Remove it to unblock CI.

Fixes: #15388
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-08-29 18:51:31 +02:00
Miloslav Trmač
1845046c16 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-08-29 17:55:39 +02:00
Miloslav Trmač
093054ae3c 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-08-29 17:55:39 +02:00
Miloslav Trmač
765c37c398 Add support for showing keyPaths in (podman image trust show)
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:39 +02:00
Miloslav Trmač
762ca8ab4e 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-08-29 17:55:39 +02:00
Miloslav Trmač
551850df8a 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-08-29 17:55:39 +02:00
Miloslav Trmač
62499f4a25 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-08-29 17:55:39 +02:00
Miloslav Trmač
8ef93bbb99 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-08-29 17:55:38 +02:00
Miloslav Trmač
79913c7154 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-08-29 17:55:38 +02:00
Miloslav Trmač
e8cd43b414 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-08-29 17:55:38 +02:00
Miloslav Trmač
d4f18670e8 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-08-29 17:55:38 +02:00
Miloslav Trmač
cbb8af30ef Recognize the new lookaside names for simple signing sigstore
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
a304b8d287 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-08-29 17:55:38 +02:00
Miloslav Trmač
721de77c40 Make the output of (podman image trust show) deterministic
Sort map keys instead of iterating in the Go-imposed random order.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
333749b804 Make most of pkg/trust package-private
We now have only a few entrypoints that are called externally,
so make the rest private.  This will make it more obvious that
we are not breaking any external users.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
5122eb7934 Move most of ImageEngine.ShowTrust into pkg/trust.PolicyDescription
This will allow us to write unit tests without setting up the complete Podman runtime
(and without the Linux dependency).

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
c413c46faf Add support for sigstoreSigned in (podman image trust set)
NOTE: This does not edit the use-sigstore-attachments value
in registries.d, similarly to how (podman image trust set) didn't
set the lookaside paths for simple signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
1f61734f4f Create new policy entries together with validating input
That way, we don't have to switch over trustType twice.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00
Miloslav Trmač
04b3cc3936 Improve validation of data in ImageEngine.SetTrust
- Also reject public keys with types that don't use them
- Reject unknown trust types
- And add unit tests

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-29 17:55:38 +02:00