Commit Graph

21445 Commits

Author SHA1 Message Date
Daniel J Walsh c2f34ed869
Merge pull request #19818 from testwill/typo
fix: default typo
2023-08-31 06:42:32 -04:00
Giuseppe Scrivano 702709a916
libpod: do not parse --hostuser in base 8
fix the parsing of --hostuser to treat the input in base 10.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-08-31 12:34:58 +02:00
guoguangwu 13342e5039 fix: default typo
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-08-31 18:14:59 +08:00
OpenShift Merge Robot 77fe460d13
Merge pull request #19805 from vrothberg/fix-19801
kube play: fix pull policy
2023-08-31 11:10:35 +02:00
OpenShift Merge Robot 779bc49967
Merge pull request #19802 from edsantiago/e2e_exit_cleanly_matcher
e2e: new ExitCleanly matcher
2023-08-31 10:49:26 +02:00
Takuya Nishimura 3a6fc8d2b7 Add Japanese locale and translation of index
Signed-off-by: Takuya Nishimura <goodisonev4@gmail.com>

Fix typo

Signed-off-by: Takuya Nishimura <goodisonev4@gmail.com>

Fix typo

Signed-off-by: Takuya Nishimura <goodisonev4@gmail.com>
2023-08-31 13:53:48 +09:00
OpenShift Merge Robot 9320efe0b8
Merge pull request #19814 from lsm5/remove-rhcontainerbot-email
remove rh.container.bot@gmail.com
2023-08-30 23:16:40 +02:00
OpenShift Merge Robot 2194bd098b
Merge pull request #19812 from baude/hypervciprep
Tweaks and cleanups to prepare hyperv for CI
2023-08-30 23:11:08 +02:00
OpenShift Merge Robot e5ab4fbc52
Merge pull request #19810 from edsantiago/bats_cleanup
system tests: housekeeping: various small fixes
2023-08-30 22:19:43 +02:00
OpenShift Merge Robot bb9256a39d
Merge pull request #19808 from zeehio/minor-doc-fixes
[CI:DOCS] Fix gidmap command in example
2023-08-30 22:17:10 +02:00
OpenShift Merge Robot bd7579a62a
Merge pull request #19806 from vrothberg/vendor-common
vendor containers/common@12405381ff
2023-08-30 22:14:35 +02:00
OpenShift Merge Robot 4051a8a23f
Merge pull request #19790 from flouthoc/conf_add_compression
manifest,push: support `add_compression` from `containers.conf`
2023-08-30 22:11:57 +02:00
Lokesh Mandvekar 39c5b7face
remove rh.container.bot@gmail.com
Don't need this email as we have podman-monitor email listed wherever
relevant.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-30 15:01:16 -04:00
Brent Baude a62abfe3d6 Tweaks and cleanups to prepare hyperv for CI
Small fixes for bugs in the hyperv code that were made obvious when
manually preparing to run pkg/machine/e2e with windows and hyperv.

Also includes vendoring a new libhvee and solves bug where json config
was not being removed.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-30 12:44:50 -05:00
Ed Santiago a0738e7e68 system tests: housekeeping: various small fixes
Fix unquoted string vars. Something like this:

   is $output "what we expect"

...will fail with a misleading error message if $output is "".

Also fix typos in a diagnostic; this was causing unhelpful message
on failure

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-30 10:06:16 -06:00
Ed Santiago 4082b67f6e CI: e2e: first use of new ExitCleanly() matcher
A nearly-trivial first effort to use the new ExitCleanly().
Requires using the new CITEST_IMAGE (see prior commit)
because nginx causes the tests to fail:

   [FAILED] Unexpected warnings seen on stderr: \
            level=warning \
            msg="HEALTHCHECK is not supported for OCI image format ...

Oh, I also took the liberty of rewriting "play kube" -> "kube play".

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-30 08:41:25 -06:00
Ed Santiago 6cbd17c0f4 CI: e2e: new ginkgo matcher, ExitCleanly()
Combined test for (exitcode == 0) && (nothing on stderr).
Returns more useful diagnostic messages than the default:

  old: Expected N to equal 0

  new: Command failed with exit status N
  new: Unexpected warnings seen on stderr: "...."

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-30 08:41:23 -06:00
Ed Santiago da1246d587 CI: e2e: fetch the standard system-test image
Finally, after so many years, let's start using testimage:YYYYMMDD.
Use it in place of LABELS_IMAGE, which nothing/nowhere was using.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-30 08:11:43 -06:00
Valentin Rothberg d20b5869f8 kube play: fix pull policy
Use the `newer` pull policy only for the "latest" tag and default to
using `missing` otherwise.  This speeds up `kube play` as it'll skip
reaching out to the registry and also fixes other side-effects described
in #19801.

Fixes: #19801
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-30 13:49:49 +02:00
Sergio Oller 18d35b6122 Fix gidmap command in example
Since we do not want the mapping to be applied to uids,
we should use the `g` flag in the mapping in the example
as well.

Follow up of #18173

Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-30 13:47:23 +02:00
Valentin Rothberg e66c04c1f7 vendor containers/common@12405381ff
When pulling from an OCI source, make sure to preseve the optional name.
For instance, a podman pull oci:/tmp/foo:quay.io/foo/bar:latest should
pull the image and name it quay.io/foo/bar:latest.

While at it, also fix a bug when pulling an OCI without the optional
name. Previously, we used the path to name the image which will error in
most cases due to invalid characters (e.g., capital ones). Hence, apply
the same trick as for the dir transport and generate a sha.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-30 13:20:35 +02:00
OpenShift Merge Robot e73e585f5d
Merge pull request #18713 from zeehio/feat-gidmap-improvements
Mapping improvements to add additional groups
2023-08-30 12:50:10 +02:00
Daniel J Walsh 8114923fd4
Merge pull request #19794 from baude/remoteusername
Small fixes for hyperv
2023-08-30 06:15:23 -04:00
OpenShift Merge Robot 16f6d6a239
Merge pull request #19784 from Jared-Sprague/troubleshooting-fuse
[CI:DOCS] Added an additional troubleshooting problem and solution
2023-08-29 20:20:07 +02:00
Aditya R b95ae3b4a3
manifest,push: support add_compression from containers.conf
Use `add_compression` field from `containers.conf` if found instead and
`CLI` field `--add-compression` is not set.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-08-29 20:57:50 +05:30
Brent Baude 1085177fee hyperv ignition: use gvforwarder instead of vm
in gvisor-vsock-tap upstream, there is a binary called 'vm' which is
used for routing traffic from a tap over something like vsock.  In
Fedora, the binary is named 'gvforwarder'.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-29 09:34:40 -05:00
Brent Baude 2a8e6acecb Set remote username earlier for hyperv
the remote username was being set too "late" for hyperv and the username
for ssh connections was blank.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-29 09:34:40 -05:00
Jared Sprague 26cefcbf98 Added an additional troubleshooting problem and solution
Signed-off-by: Jared Sprague <jared@caramelcode.com>
2023-08-29 09:41:38 -04:00
OpenShift Merge Robot 29f4572f9f
Merge pull request #19783 from mtrmac/ManifestListData-no-deps
Update c/common to remove a dependency on libimage
2023-08-29 14:44:59 +02:00
OpenShift Merge Robot 94969a063a
Merge pull request #19768 from chnrxn/patch-1
/_ping handler: return OSType http header
2023-08-29 13:25:18 +02:00
OpenShift Merge Robot 666c1167b8
Merge pull request #19780 from cevich/remove_multiarch_cron
Cirrus: Remove multi-arch podman image builds
2023-08-29 13:22:08 +02:00
Miloslav Trmač a3c2d6ad2e Remove a dependency on libimage from pkg/bindings
... by updating for a c/common API change.

[NO NEW TESTS NEEDED]: Only moves unchanged code,
should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-08-29 12:45:55 +02:00
OpenShift Merge Robot b4aed53ea6
Merge pull request #19782 from mtrmac/specgen-duplicate-inspect
Don't re-inspect an image
2023-08-29 10:15:09 +02:00
OpenShift Merge Robot 28ad5a32fa
Merge pull request #19781 from mtrmac/api-handlers-types-no-impl
Remove a dependency on libimage from pkg/api/handlers
2023-08-29 09:56:32 +02:00
OpenShift Merge Robot ed819d4cc1
Merge pull request #19785 from yylyyl/main
Rename parameter in pkg/bindings
2023-08-29 09:40:58 +02:00
Yiliang Yang f1c24df4f6 Rename parameter in pkg/bindings
In `pkg/bindings/containers/ResizeExecTTY`, `sessionID` is the actual required
parameter, instead of `nameOrId`.

[NO NEW TESTS NEEDED]

Signed-off-by: Yiliang Yang <yangyiliang@gmail.com>
2023-08-28 18:26:59 -04:00
Miloslav Trmač 259ab85943 Remove a dependency on libimage from pkg/api/handlers
pkg/api/handlers is used for type definitions by pkg/bindings,
i.e. podman-remote; a libimage dependency means that podman-remote
would also include libimage.

Instead, move the ImageDataToImageInspect function close to the
only user (and make it private).

[NO NEW TESTS NEEDED]: Only moves unchanged code (apart from a required
warning fix), should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-08-28 23:05:30 +02:00
Miloslav Trmač 4cac1d3bcb Don't re-inspect an image
getImageFromSpec has just make exactly the same Inspect call.

[NO NEW TESTS NEEDED]: This adds no new functionality, and
it's hard to test that a duplicate call didn't happen without
(intrusive and hard-to-maintain) mocks.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-08-28 22:43:23 +02:00
Chris Evich 99834947dc
Cirrus: Remove multi-arch podman image builds
These jobs have been failing since early August due to
technical/scripting problems.  Disable/remove entirely since a fix is
unlikely to be implemented anytime soon.

Ref: Abandoned recent attempt at debugging
https://github.com/containers/podman/pull/19720

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-08-28 16:15:20 -04:00
Sergio Oller 91b8bc7f13 uid/gid mapping flags
Motivation
===========

This feature aims to make --uidmap and --gidmap easier to use, especially in rootless podman setups.

(I will focus here on the --gidmap option, although the same applies for --uidmap.)

In rootless podman, the user namespace mapping happens in two steps, through an intermediate mapping.

See https://docs.podman.io/en/latest/markdown/podman-run.1.html#uidmap-container-uid-from-uid-amount
for further detail, here is a summary:

First the user GID is mapped to 0 (root), and all subordinate GIDs (defined at /etc/subgid, and
usually >100000) are mapped starting at 1.

One way to customize the mapping is through the `--gidmap` option, that maps that intermediate mapping
to the final mapping that will be seen by the container.

As an example, let's say we have as main GID the group 1000, and we also belong to the additional GID 2000,
that we want to make accessible inside the container.

We first ask the sysadmin to subordinate the group to us, by adding "$user:2000:1" to /etc/subgid.

Then we need to use --gidmap to specify that we want to map GID 2000 into some GID inside the container.

And here is the first trouble:

Since the --gidmap option operates on the intermediate mapping, we first need to figure out where has
podman placed our GID 2000 in that intermediate mapping using:

    podman unshare cat /proc/self/gid_map

Then, we may see that GID 2000 was mapped to intermediate GID 5. So our --gidmap option should include:

    --gidmap 20000:5:1

This intermediate mapping may change in the future if further groups are subordinated to us (or we stop
having its subordination), so we are forced to verify the mapping with
`podman unshare cat /proc/self/gid_map` every time, and parse it if we want to script it.

**The first usability improvement** we agreed on #18333 is to be able to use:

    --gidmap 20000:@2000:1

so podman does this lookup in the parent user namespace for us.

But this is only part of the problem. We must specify a **full** gidmap and not only what we want:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1

This is becoming complicated. We had to break the gidmap at 5, because the intermediate 5 had to
be mapped to another value (20000), and then we had to keep mapping all other subordinate ids... up to
close to the maximum number of subordinate ids that we have (or some reasonable value). This is hard
to explain to someone who does not understand how the mappings work internally.

To simplify this, **the second usability improvement** is to be able to use:

   --gidmap "+20000:@2000:1"

where the plus flag (`+`) states that the given mapping should extend any previous/default mapping,
overriding any previous conflicting assignment.

Podman will set that mapping and fill the rest of mapped gids with all other subordinated gids, leading
to the same (or an equivalent) full gidmap that we were specifying before.

One final usability improvement related to this is the following:

By default, when podman  gets a --gidmap argument but not a --uidmap argument, it copies the mapping.
This is convenient in many scenarios, since usually subordinated uids and gids are assigned in chunks
simultaneously, and the subordinated IDs in /etc/subuid and /etc/subgid for a given user match.

For scenarios with additional subordinated GIDs, this map copying is annoying, since it forces the user
to provide a --uidmap, to prevent the copy from being made. This means, that when the user wants:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1

The user has to include a uidmap as well:

    --gidmap 0:0:5 --gidmap 5:6:15000 --gidmap 20000:5:1 --uidmap 0:0:65000

making everything even harder to understand without proper context.

For this reason, besides the "+" flag, we introduce the "u" and "g" flags. Those flags applied to a
mapping tell podman that the mapping should only apply to users or groups, and ignored otherwise.

Therefore we can use:

   --gidmap "+g20000:@2000:1"

So the mapping only applies to groups and is ignored for uidmaps. If no "u" nor "g" flag is assigned
podman assumes the mapping applies to both users and groups as before, so we preserve backwards compatibility.

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-28 20:21:04 +02:00
Sergio Oller 18c2a2be87 [DOC] Clarify default behaviour on uidmap
Specify that by default if only one of uidmap or gidmap is given, the other one is copied

Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Sergio Oller <sergioller@gmail.com>
2023-08-28 20:21:04 +02:00
OpenShift Merge Robot f83ca0490a
Merge pull request #19754 from baude/updatelibhvee
update libhvee
2023-08-28 19:53:50 +02:00
OpenShift Merge Robot 8bda49608f
Merge pull request #19696 from Luap99/api-stream-format
api docs: document stream format
2023-08-28 19:43:24 +02:00
OpenShift Merge Robot 341fb14e77
Merge pull request #19774 from containers/renovate/github.com-vbauerster-mpb-v8-8.x
Update module github.com/vbauerster/mpb/v8 to v8.6.0
2023-08-28 19:40:42 +02:00
OpenShift Merge Robot ef4ca8b2f0
Merge pull request #19762 from ygalblum/kube-support-list
Kube - support List documents
2023-08-28 19:37:57 +02:00
OpenShift Merge Robot 4d2fe27b1c
Merge pull request #19777 from baude/updatecommon
Update containers/common to latest
2023-08-28 19:29:24 +02:00
OpenShift Merge Robot 5c1760a2b2
Merge pull request #19775 from edsantiago/another_kube_play_logs_race
e2e: fix race condition (kube play + logs)
2023-08-28 18:27:41 +02:00
Brent Baude 60e3b5ef13 Update containers/common to latest
[NOI NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-28 09:56:54 -05:00
Brent Baude fe3c4562f1 update libhvee
this version of libhvee contains fixes related to machine stop required
for windows hyperv

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-08-28 09:53:06 -05:00
OpenShift Merge Robot dd2ec7c613
Merge pull request #19640 from flouthoc/force-compression
push/manifest-push: add support for `--force-compression` to prevent reusing other blobs
2023-08-28 16:49:31 +02:00