Commit graph

23873 commits

Author SHA1 Message Date
Paul Holzinger
fdb736d282
apple virtiofs: fix racy mount setup
One problem on FCOS is that the root directory is immutable, as such in
order to mount arbitrary paths from the host we must make it mutable
again and create these dir on boot in order to be able to mount there.

The current logic was racy as it used one unit for each path and they
all did chattr -i /; mkdir -p $path; chattr -i / and systemd can run
these units in parallel. That means it was possible for another unit to
make / immutable before the unit could do the mkdir. I pointed this out
on the original PR[1] but we never followed up on it...

Now this here changes several things. First have one unit that does the
chattr -i / (immutable-root-off.service), it is hooked into
remote-fs-pre.target which means it is executed before the network
mounts (virtiofs) are done.

Then we have another unit that does chattr +i /
(immutable-root-on.service) which turn the immutable root back on after
remote-fs.target which means all mount are done at this point.

Additionally the automount unit is removed because it does not add any
value for us and it was borken anyway as it used the virtiofs tag as
path so systemd just ignored it.

[1] https://github.com/containers/podman/pull/20612#discussion_r1384846241

Fixes #22569

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-27 14:24:07 +02:00
Paul Holzinger
67df6d60c3
cirrus: fix broken macos artifacts URL
The task got renamed but didn't fix the URL for the machine test task
only the artifacts task url was fixed.

Fixes 439fe90208 ("Minor: Rename the OSX Cross task")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-27 14:24:07 +02:00
openshift-merge-bot[bot]
6abdda6d7b
Merge pull request #23116 from Luap99/top-compile
libpod/container_top_linux.c: fix missing header
2024-06-27 11:49:01 +00:00
Paul Holzinger
6db8ff7f7b
libpod/container_top_linux.c: fix missing header
As this file uses open it needs to include fcntl.h.
This should fix the build error seen on epel9[1], not sure why it works
on the other platforms.

[1] https://download.copr.fedorainfracloud.org/results/packit/containers-podman-23113/epel-9-aarch64/07672197-podman/builder-live.log.gz

Fixes 65ed96585d ("podman top: join the container userns")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-27 10:50:17 +02:00
Kevin Cui
3703cbf1d7
refactor(build): improve err when file specified by -f does not exist
When the user specifies a Containerfile or Dockfile with the -f flag in podman build, if the file does not exist, the error should be intuitive to the user.

Fixed: #22940

Signed-off-by: Kevin Cui <bh@bugs.cc>
2024-06-27 14:12:20 +08:00
Chris Evich
905e7ae070
Minor: Remove unhelpful comment
Likely a copy-paste error, it doesn't apply here.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-06-26 14:54:17 -04:00
openshift-merge-bot[bot]
fda0f8123b
Merge pull request #23098 from Luap99/CI-bail
cirrus: remove redundant skip logic and lower int timeout
2024-06-26 18:38:06 +00:00
openshift-merge-bot[bot]
341fbfea66
Merge pull request #23110 from lsm5/rpm-misc
[skip-ci] Remove conditionals from changelog
2024-06-26 17:29:22 +00:00
openshift-merge-bot[bot]
eff706af6f
Merge pull request #23105 from cevich/rename_osx_cross
[CI:BUILD] Minor: Rename the OSX Cross task
2024-06-26 17:26:39 +00:00
renovate[bot]
541cdaa441
Update module github.com/openshift/imagebuilder to v1.2.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-26 17:25:24 +00:00
openshift-merge-bot[bot]
ab02fe292f
Merge pull request #23086 from cevich/lint_in_parallel
Run linting in parallel with building
2024-06-26 17:23:56 +00:00
Chris Evich
439fe90208
Minor: Rename the OSX Cross task
For a long time, this task has not been cross-compiling, it's building
natively on a Mac.  Avoid any possible confusion by renaming the task.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-06-26 10:49:00 -04:00
openshift-merge-bot[bot]
d386cd0b29
Merge pull request #23096 from Luap99/top-userns
podman top: join the container userns
2024-06-26 13:13:40 +00:00
Lokesh Mandvekar
02b922ebfc
[skip-ci] Remove conditionals from changelog
All our active envs except centos stream 9 support autochangelog and the
only place we're building rpms via packit on centos stream 9 is on COPR
where we don't really care about changelogs.

Commit also removes a couple of unnecessary slashes from install paths.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-06-26 08:38:11 -04:00
Paul Holzinger
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
openshift-merge-bot[bot]
5e27243935
Merge pull request #23103 from Luap99/build-platform
build API: accept platform comma separated
2024-06-25 22:06:07 +00:00
Chris Evich
6c75a10875
Run linting in parallel with building
Linting code changes with golangci-lint is a very slow and resource
intensive process.  However, it does not depend on compiling anything.
This means it may run in parallel with the build tasks for
a modest perceived runtime duration improvement.

Additionally, the former validation make targets that **do** require a
build execute faster than CI is able to provision a VM, simply tack them
onto the end of all build operations.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-06-25 14:27:56 -04:00
Chris Evich
7ff4bbae26
Fix missing Makefile target dependency
This was likely hidden by the CI system.  Fix it.

Signed-off-by: Chris Evich <cevich@redhat.com>
2024-06-25 14:12:55 -04:00
openshift-merge-bot[bot]
242fdb51a2
Merge pull request #23101 from edsantiago/exitwitherror-yetmore
ExitWithError() - more upgrades from Exit()
2024-06-25 18:01:40 +00:00
openshift-merge-bot[bot]
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
openshift-merge-bot[bot]
4ba26b15f1
Merge pull request #23099 from Luap99/remove-12624
test/e2e: remove podman system service tests
2024-06-25 17:49:07 +00:00
openshift-merge-bot[bot]
781d5dd154
Merge pull request #23097 from Luap99/machine-stop
pkg/machine/apple: machine stop timeout
2024-06-25 17:35:21 +00:00
openshift-merge-bot[bot]
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
openshift-merge-bot[bot]
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
Paul Holzinger
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
Lokesh Mandvekar
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
Ed Santiago
de58c5f292 ExitWithError() - more upgrades from Exit()
Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-06-25 10:07:56 -06:00
Paul Holzinger
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
Paul Holzinger
a0b2b0d34c
cirrus: reduce int tests timeout
Integration tests run around 15-20 mins now. Lower the timeout to 30m,
if we hit this something is very wrong and needs to be looked at and
there is no point in waiting much longer in case of a hang.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-25 16:51:28 +02:00
Paul Holzinger
8f2d403cd1
cirrus: remove redundant skip logic
As of commit d9183f0587 we use the cirrus.yml skip logic to skip based
on source changes. As such the add hoc logic inside our test setup can
be removed. However as I did not yet implement the skip logic for all
tests task in cirrus.yml it must remain for the other tasks for now.
I plan to migrate the other in a week or two once we are confident that
the cirrus.yml logic works well for us.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-25 16:44:54 +02:00
Paul Holzinger
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
Ed Santiago
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
openshift-merge-bot[bot]
f62c3ec561
Merge pull request #23083 from Luap99/restore-hosts
restore: fix missing network setup
2024-06-25 11:29:20 +00:00
openshift-merge-bot[bot]
ac4143adda
Merge pull request #23087 from edsantiago/exitwitherror-more
ExitWithError(): continued
2024-06-25 11:23:50 +00:00
openshift-merge-bot[bot]
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
renovate[bot]
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
openshift-merge-bot[bot]
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
Ed Santiago
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
openshift-merge-bot[bot]
0563fb4217
Merge pull request #22920 from cgwalters/virtiofsd-machine
machine/linux: Switch to virtiofs by default
2024-06-24 17:58:08 +00:00
Yiqiao Pu
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
Paul Holzinger
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
Paul Holzinger
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
openshift-merge-bot[bot]
32d4b1644d
Merge pull request #23079 from slp/add-krunkit-packaging
macos-installer: bundle krunkit
2024-06-24 14:45:32 +00:00
openshift-merge-bot[bot]
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
openshift-merge-bot[bot]
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
Sergio Lopez
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
openshift-merge-bot[bot]
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
Paul Holzinger
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
Paul Holzinger
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
openshift-merge-bot[bot]
7b4f6ec576
Merge pull request #22987 from edsantiago/exitwitherror-yetmore
ExitWithError() - more upgrades from Exit()
2024-06-24 11:06:57 +00:00