22854 Commits

Author SHA1 Message Date
65ed96585d podman top: join the container userns
When we execute ps(1) in the container and the container uses a userns
with a different id mapping the user id field will be wrong.

To fix this we must join the userns in such case.

Fixes #22293

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-26 11:10:56 +02:00
5e27243935 Merge pull request #23103 from Luap99/build-platform
build API: accept platform comma separated
2024-06-25 22:06:07 +00:00
242fdb51a2 Merge pull request #23101 from edsantiago/exitwitherror-yetmore
ExitWithError() - more upgrades from Exit()
2024-06-25 18:01:40 +00:00
4220ee02f7 Merge pull request #23081 from edsantiago/logformatter-base-sha
CI: logformatter: link to correct PR base
2024-06-25 17:55:01 +00:00
4ba26b15f1 Merge pull request #23099 from Luap99/remove-12624
test/e2e: remove podman system service tests
2024-06-25 17:49:07 +00:00
781d5dd154 Merge pull request #23097 from Luap99/machine-stop
pkg/machine/apple: machine stop timeout
2024-06-25 17:35:21 +00:00
577ebe7998 Merge pull request #23095 from lsm5/rpm-machine-subpackage
[skip-ci] RPM: create podman-machine subpackage
2024-06-25 17:32:40 +00:00
ff395915be Merge pull request #23091 from containers/renovate/github.com-crc-org-crc-v2-2.x
Update module github.com/crc-org/crc/v2 to v2.38.0
2024-06-25 17:22:02 +00:00
a3d5842746 build API: accept platform comma separated
The docker API uses only a single arg for platform and multiple
platforms are given as comma separated list.

Fixes #22071

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-25 18:48:59 +02:00
180cc6f863 [skip-ci] RPM: create podman-machine subpackage
This subpackage will fetch dependencies for podman machine and create a
symlink /usr/libexecdir/podman/virtiofsd -> ../virtiofsd .

Co-authored-by: Colin Walters <walters@verbum.org>
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-06-25 12:08:37 -04:00
de58c5f292 ExitWithError() - more upgrades from Exit()
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-25 10:07:56 -06:00
a7415c9316 test/e2e: remove podman system service tests
Two tests are skipped for a long time because they flaked to much,
nobody cares about them and there are only debugging endpoints mostly so
it is not critical either.

The "of 2 seconds" tests isn't useful either. It waits up to 30s for the
exit so it doesn't actually verify a proper timeout. Additionally we
have similar checks in the system tests "podman system service -
CORS enabled in logs" so I consider this safe to remove.

Fixes #12624

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-25 17:00:01 +02:00
7562f4ccdb pkg/machine/apple: machine stop timeout
The current timeout was not long enough. Systemd default is 90s so we
should wait for at least that long. Also it really doesn't make sense to
throw an error we saying we failed waiting for stop. We should hard
terminate the VM in case a graceful shutdown did not happen.

Fixes #22515

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-25 15:54:13 +02:00
1a6a200403 CI: logformatter: link to correct PR base
Two enormous misunderstandings:

  1) $CIRRUS_BASE_SHA is worthless. I thought it was, you know,
     the BASE SHA of the current commit, but (as best I can tell)
     it seems to be the SHA of the most recent commit on the
     destination branch. Cirrus docs are unhelpful. Anyhow,
     it's clearly not anything useful. Stop using it.

  2) $EPOCH_TEST_COMMIT is closer to what we want. It is
     defined in Makefile as the git merge-base. But for unknown
     reasons it was being clobbered in CI scripts, and it
     doesn't seem to work in all contexts, so, eliminate it
     from CI setup scripts. Leave it only in Makefile.

This leaves us with no option other than defining our own
merge-base variable, PR_BASE_SHA. Do so and pass it along
to rootless jobs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-25 06:53:59 -06:00
f62c3ec561 Merge pull request #23083 from Luap99/restore-hosts
restore: fix missing network setup
2024-06-25 11:29:20 +00:00
ac4143adda Merge pull request #23087 from edsantiago/exitwitherror-more
ExitWithError(): continued
2024-06-25 11:23:50 +00:00
c0ec20b98d Merge pull request #22736 from ypu/quadlet_journald
test/system: Add test for journald log check in quadlet
2024-06-25 09:20:04 +00:00
d1bfc6d8d0 Update module github.com/crc-org/crc/v2 to v2.38.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-25 07:59:35 +00:00
d4c4801dcd Merge pull request #23082 from Luap99/pod-id-file
podman run use pod userns even with --pod-id-file
2024-06-25 07:57:29 +00:00
f50734636c ExitWithError(): continued
More Exit(x) -> ExitWithError(x, "expected message")

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-24 12:51:30 -06:00
0563fb4217 Merge pull request #22920 from cgwalters/virtiofsd-machine
machine/linux: Switch to virtiofs by default
2024-06-24 17:58:08 +00:00
31888f23aa test/system: Add test steps for journald log check in quadlet
Add some test steps into quadlet - ContainerName. These steps are
used to ensure the default configuration for quadlets generated
service files is sending stdout/stderr/syslog to the journald.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2024-06-25 01:25:04 +08:00
def182d396 restore: fix missing network setup
The restore code path never called completeNetworkSetup() and this means
that hosts/resolv.conf files were not populated. This fix is simply to
call this function. There is a big catch here. Technically this is
suposed to be called after the container is created but before it is
started. There is no such thing for restore, the container runs right
away. This means that if we do the call afterwards there is a short
interval where the file is still empty. Thus I decided to call it
before which makes it not working with PostConfigureNetNS (userns) but
as this does not work anyway today so  I don't see it as problem.

Fixes #22901

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-24 18:52:02 +02:00
a158eae7ff podman run use pod userns even with --pod-id-file
The pod was set after we checked the namespace and the namespace code
only checked the --pod flag but didn't consider --pod-id-file option.
As such fix the check to first set the pod option on the spec then use
that for the namespace. Also make sure we always use an empty default
otherwise it would be impossible in the backend to know if a user
requested a specific userns or not, i.e. even in case of a set
PODMAN_USERNS env a container should still get the userns from the pod
and not use the var in this case. Therefore unset it from the default
cli value.

There are more issues here around --pod-id-file and cli validation that
does not consider the option as conflicting with --userns like --pod
does but I decided to fix the bug at hand and don't try to fix the
entire mess which most likely would take days.

Fixes #22931

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-24 17:18:08 +02:00
32d4b1644d Merge pull request #23079 from slp/add-krunkit-packaging
macos-installer: bundle krunkit
2024-06-24 14:45:32 +00:00
80cf0e23ec Merge pull request #23080 from Luap99/remote-err
libpod API: fix two pod remote error messages
2024-06-24 13:50:32 +00:00
fe18a872f7 Merge pull request #23068 from ashley-cui/speedymacci
pkg/machine/e2e: Remove unnecessary copy of machine image.
2024-06-24 12:58:16 +00:00
5815195528 macos-installer: bundle krunkit
Extend Makefile and package.sh to download, sign and bundle krunkit and
its dependencies into the package.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-06-24 14:42:04 +02:00
1128e5b410 Merge pull request #23072 from marinmo/update-systemd-unit.md
[CI:DOCS] Add information about Type=oneshot units in podman-systemd.unit.5.md (fixes #22233)
2024-06-24 12:27:59 +00:00
e404976d1b remote API: fix pod top error reporting
Do not return 200 status code before we know if there will be an error.
Delay writing the status code until we send the first response. That way
we can set an error code inside the loop when we get a error on the
first try, i.e. because an invalid descriptor was used.

Fixes #22986

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-24 13:47:01 +02:00
29ecf5984c libpod API: return proper error status code for pod start
When we failed to do anything we should return 500, the 409 code has a
special meaing to the client as it uses a different error format. As
such the remote client was not able to unmarshal the error correctly and
just returned an empty string.

Fixes #22989

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-24 13:46:55 +02:00
7b4f6ec576 Merge pull request #22987 from edsantiago/exitwitherror-yetmore
ExitWithError() - more upgrades from Exit()
2024-06-24 11:06:57 +00:00
673dde9ec5 Merge pull request #23043 from miyamo2/feat/issues#23038
fix(diff): do not suggest `--latest` when runs on remote with no args
2024-06-24 07:24:55 +00:00
945226a844 fix #22233
Add information about Type=oneshot units as suggested in https://github.com/containers/podman/issues/22233

Signed-off-by: marinmo <bugzilla@marinmo.org>
2024-06-23 19:11:51 +02:00
5d009715f6 added check for registry.IsRemote(). and correct error message.
Signed-off-by: miyamo2 <miyamo2@outlook.com>
2024-06-23 15:45:41 +00:00
57fe4c43b3 Merge pull request #23073 from marinmo/update-systemd-unit.md2
[CI:DOCS] Use true/false for booleans in podman-systemd.unit.5.md (fixes #20686)
2024-06-23 15:03:08 +00:00
bf2de4177b Merge pull request #23064 from giuseppe/podman-pass-timeout-stop-to-systemd
container: pass StopTimeout to the systemd slice
2024-06-23 14:57:55 +00:00
e4f64f91fe fix #20686
Change the document to only use true/false for booleans. Fixes https://github.com/containers/podman/issues/20686.

Signed-off-by: marinmo <bugzilla@marinmo.org>
2024-06-22 22:17:24 +02:00
25bc426fb0 Merge pull request #23032 from giuseppe/drop-make-accessible
libpod: do not chmod bind mounts
2024-06-22 13:45:10 +00:00
42a01c0f0c Merge pull request #22967 from rhatdan/build
Remove references to --pull=true and --pull=false
2024-06-21 19:27:36 +00:00
794c139d5e Merge pull request #23020 from cevich/rm_cgv1
CI Cleanup: Remove cgroups v1 & runc support
2024-06-21 19:11:10 +00:00
4dc98e3a5a pkg/machine/e2e: Remove unnecessary copy of machine image.
Stop copying the pre-pulled uncompressed machine disk into the individual test dir. The machine pull code already makes a copy of the disk into the test's HOMEDIR/.local/share/containers/podman/machine, and works off that copy.

Before the change: TESTDIR/<image> is copied to TESTDIR/podman_test/<image> by the test, and then podman machine copies the image to TESTDIR/podman_test/.local/share/containers/podman/machine/provider/<image>

After the change: TESTDIR/<image> is copied to TESTDIR/podman_test/.local/share/containers/podman/machine/provider/<image> by podman machine

The image that is actually run is at TESTDIR/podman_test/.local/share/containers/podman/machine/provider/<image> in both instances.

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-06-21 12:54:24 -04:00
49eb5af301 libpod: intermediate mount if UID not mapped into the userns
if the current user is not mapped into the new user namespace, use an
intermediate mount to allow the mount point to be accessible instead
of opening up all the parent directories for the mountpoint.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-21 18:01:26 +02:00
08a8429459 libpod: avoid chowning the rundir to root in the userns
so it is possible to remove the code to make the entire directory
world accessible.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-21 18:01:26 +02:00
c81f075f43 libpod: do not chmod bind mounts
with the new mount API is available, the OCI runtime doesn't require
that each parent directory for a bind mount must be accessible.
Instead it is opened in the initial user namespace and passed down to
the container init process.

This requires that the kernel supports the new mount API and that the
OCI runtime uses it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-21 18:01:26 +02:00
094bc673ef libpod: unlock the thread if possible
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-06-21 18:01:26 +02:00
d53fee511f CI Cleanup: Remove cgroups v1 support
With (esp. Debian) CI VM images built by
https://github.com/containers/automation_images/ pull/338 CI no-longer
tests with runc nor cgroups v1.  Add logic to fail under these
conditions.  Prune back high-level YAML/script envars and logic formerly
required to support these things.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-06-21 10:08:39 -04:00
9ffac33178 Merge pull request #23066 from Luap99/connection-setup
remote: fix incorrect CONTAINER_CONNECTION parsing
2024-06-21 13:29:10 +00:00
d810f4187e ExitWithError() - more upgrades from Exit()
Add error-message checks to pod_xxxx_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-21 06:26:42 -06:00
4b3890ccac remote: fix incorrect CONTAINER_CONNECTION parsing
When a user specifies a invalid connection in CONTAINER_CONNECTION then
podman should return a proper error saying so. Currently it ignored the
error and in rootFlags() just exited early with defining any flags. This
caused a panic then when trying to use the flags later.

In order to address this first store the connection error in the
PodmanConfig struct and not abort right away during flag setup. This is
important as the user might have specified a flag with a valid remote
connection. As such we check all flags and only when none were given we
return the connection error.

Also while at it I noticed that the default connection reported via
podman --help was wrong as it only used the old containers.conf field
for it and did not consider the podman-connections.json default.

New regression tests have been added to make sure it behaves correctly.

This fixes the problem reported in the PR #22997.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-21 14:01:22 +02:00