When returning error http code (e.g. 4xx, 5xx) the body needs to contain
a JSON that has a key "message" in it,
we must not use jsonmessage.JSONMessage.
The JSON of shape jsonmessage.JSONMessage is used only when client
already received 200.
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
So when running remote and rootless tests the buildImage() thing has one
big problem because it used the main test tmpdir as context.
However that dir also holds all the image layers with files that are
owned by other uids and because podman-remote does not use the userns it
cannot read some files and then fails when trying to tar up the context
dir.
To fix this use an extra sub directory. Now because some tests where
using the parent directory to supply context files just switch the
callers so they have full control still.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
With podman-remote we do not enter a our user namespace like we do with
local podman so we keep running with the real user id.
So if we then try to use chrootarchive as normal user it fails with:
creating mount namespace before pivot: operation not permitted
So simply revert back to the normal archive code.
Now the more interesting thing is we do have a test
"podman save to directory with oci format" but it never runs
rootless+remote in our CI system with our current matrix as we wanted to
reduce jobs.
So rethink the matrix and add one such job as this shows it is needed.
Fixes: 25aee24cbd ("use chrootarchive over plain archive package")
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This was report on of of my PRs, I do not know why this fails there all
of the sudden, it seems golangci-lint has gotten flaky recently.
Locally the linter passes without this change just fine but in CI this
seems to fail:
Error: cmd/podman-testing/call.go:58:22: SA4023(related information): the lhs of the comparison is the 1st return value of this function call (staticcheck)
reflectionClient := reflectionv1.NewServerReflectionClient(grpcClient)
^
Error: cmd/podman-testing/call.go:59:5: SA4023: this comparison is never true (staticcheck)
if reflectionClient == nil {
^
The lint seems right, NewServerReflectionClient never returns nil so
lets just fix it.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Clarify that auto-generated names may use underscores, that DNS-enabled
networks resolve container names as given, and that container_name_as_hostname
changes the UTS hostname only.
Fixes: https://github.com/containers/podman/issues/28754
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
1. Add [[shell]] section, which is for shfmt only to apply formatting to
shell files that does not end with .sh or bash, but with a shebang
line present.
2. Add space_redirects = true setting for shfmt.
Note the [[language]] syntax is not officially supported by editorconfig
standard (the discussion since at least 2019 is still ongoing, see [1])
but is supported by shfmt since v3.8.0 (February 2024).
[1]: https://github.com/editorconfig/editorconfig/issues/404
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Migrate release to use release-build-artifacts action. This re-usable build action is tested nightly, so hopefully this will make our release automation more stable, as we may catch issues in our nightly runs. Followup to https://github.com/podman-container-tools/podman/pull/28176
Signed-off-by: Ashley Cui <acui@redhat.com>
To make it a bit more obvious when any CI related files such as github
workflows are touched add a label.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This fixes two problems when parsing ports.
First, check for host port conflicts. When we are given the same ip:host
port combo twice then we need to reject that as invalid, the backend
cannot bind the same port twice and thus we always get a runtime
failure. Failing early in the create code path is much better.
Second, when assigning random ports for expose we still have to check
for proper conflicts. The first error was using allUsedContainerPortsMap
to check for conflicts but this holds container side ports, we need to
ensure there are no conflicts on the host port.
Then there was the other issue that the array in the map was copied and
accessed by value on lookup. And because the code did not reassign the
value it then failed to actually update the correct ports.
To address that I switch the map to store the array by reference which
will avoid the bigger copies as we only need to update the pointer now.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
The `podman stop - basic test` flakes in CI because $SECONDS is
integer-precision: a ~14.6s stop rounds to delta_t=15 and fails
the -le 14 check. Widen the upper bound to 18s, which still catches
real regressions while tolerating slow CI nodes and remote-mode
socket overhead.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
After checkpoint the SHM tmpfs can briefly return EBUSY while the
kernel releases mount propagation references. Use lazy unmount
instead of retrying, as suggested by review.
Fixes flake: `podman checkpoint/restore ip and mac handling`
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
After _check_health "First failure" returns with FailingStreak=2, the
3rd failure fires during the subsequent systemctl checks (~1s interval),
emitting the "unhealthy" event before current_time was captured. Move
current_time before those checks so --since doesn't miss the event.
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Test: `podman container rm --force doesn't leave running processes`
Under CI load, podman-inspect takes 2-3s per call, longer than the
2s stop-timeout window. Increase to 20s so the test reliably catches
the "stopping" state before it transitions to "exited".
Signed-off-by: Jan Rodák <hony.com@seznam.cz>