19293 Commits

Author SHA1 Message Date
3794d067e0 Merge pull request #18997 from containers/renovate/google.golang.org-protobuf-1.x
Update module google.golang.org/protobuf to v1.31.0
2023-06-26 22:45:13 +02:00
c2d46acdea Merge pull request #18980 from vrothberg/bz-2216700
make image listing more resilient
2023-06-26 22:42:37 +02:00
68f71f49d6 Merge pull request #19002 from giuseppe/skip-devices-userns
specgen: raise error with --device-cgroup-rule in a userns
2023-06-26 22:34:54 +02:00
6a742cb2f5 Merge pull request #18981 from rhatdan/quadlet
Trim whitespace from unit files while parsing
2023-06-26 22:29:42 +02:00
227c07aebc specgen: honor --device-cgroup-rule with a new user namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-26 17:36:55 +02:00
0220f33384 specgen, rootless: raise error with --device-cgroup-rule
we were silently ignoring --device-cgroup-rule in rootless mode.  Make
sure an error is returned if the user tries to use it.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-26 17:36:55 +02:00
db37d66cd1 make image listing more resilient
Handle more TOCTOUs operating on listed images.  Also pull in
containers/common/pull/1520 and containers/common/pull/1522 which do the
same on the internal layer tree.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2216700
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-26 16:34:26 +02:00
3a013b6256 Merge pull request #18998 from edsantiago/bats_prefetch
system tests: add and use _prefetch
2023-06-26 16:08:45 +02:00
dde6bcbca3 system tests: add and use _prefetch
Add new _prefetch helper for fetching and caching images.
Use it in a few places, most importantly 120-load.bats
where our teardown() now runs 'rmi -af'.

Reason: in #17911 we discovered that podman save + load do
not actually preserve the image: annotations and other metadata
are lost. This means that a test which runs after 120-load.bats
is operating on a different $IMAGE than a test which runs before.

This is not a problem except in very obscure corner cases, like
one fixed in #18542, but it seems irresponsible to just handwave
that issue away

The _prefetch function uses skopeo for fetching and saving
images, because skopeo preserves digests and metadata.

[Side note for posterity: I tried amending basic_setup() to
always rmi -a + prefetch, instead of the current images -a +
rmi unwanted ones. That slowed down system tests by 10 minutes,
presumably because loads are much slower than queries. I reverted
that change and am documenting it as a reminder of why we do things
the way we do.]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-26 06:51:01 -06:00
17a18b16cb Update module google.golang.org/protobuf to v1.31.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 12:34:44 +00:00
1bca2d6a1e Merge pull request #18983 from Luap99/api-top
pkg/api: top return error to client
2023-06-26 08:12:29 +02:00
bc5269f187 Trim whitespace from unit files while parsing
Fixes: https://github.com/containers/podman/issues/18979

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-25 06:33:37 -04:00
384638861b Merge pull request #18978 from rhatdan/man1
[CI:DOCS] Fix example on PublishPort
2023-06-23 20:57:22 +02:00
9f4ee47dc4 Merge pull request #18932 from lsm5/packit-cleanup
[CI:BUILD] Packit: cleanups
2023-06-23 17:49:31 +02:00
0ee19f08cf pkg/api: BufferedResponseWriter flush correctly
Somehow my error message in top was never printed for the compat API,
the libpod one using the same code worked fine. Turns out the compat one
is using this buffered writter instaed but never made sure to flush it
before closing the connection.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-23 16:51:22 +02:00
d0505d6bac pkg/api: top return error to client
Wait before sending status code 200 for the first top call and if that
fails return a proper error code.

This was leading to some confusion in [1] because podman just reported
200 but did not wirte anything back.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2215572

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-23 16:48:57 +02:00
84454987f5 Merge pull request #18974 from vrothberg/fix-13627
podman wait: support healthy/unhealthy
2023-06-23 16:03:50 +02:00
1398cbce8a container wait: support health states
Support two new wait conditions, "healthy" and "unhealthy".  This
further paves the way for integrating sdnotify with health checks which
is currently being tracked in #6160.

Fixes: #13627
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 14:16:32 +02:00
b680daa2de [CI:DOCS] Fix example on PublishPort
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-23 06:47:05 -04:00
811867249b container wait API: use string slice instead of state slice
Massage the internal APIs to use a string slice instead of a state slice
for passing wait conditions.  This paves the way for waiting on
non-state conditions such as "healthy".

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 09:26:30 +02:00
64153ace05 podman wait: update man page
While reading the code I found the man page to be lacking some
information that I found worth mentioning and clarifying.
In particular, how the command behaves with respect to exit codes and
when more than one condition is specified.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 09:26:30 +02:00
49e0bde2bf Merge pull request #18946 from Luap99/slirp4netns
use slirp4netns code from c/common
2023-06-22 16:15:18 +02:00
436df1ba1f Merge pull request #18971 from edsantiago/silence_esrch
StopContainer(): ignore one more conmon warning
2023-06-22 16:10:07 +02:00
260e952fc9 Merge pull request #18969 from danishprakash/env-merge-fix
run,create: modify `--env-merge` behavior for non-existent vars
2023-06-22 14:21:59 +02:00
a699ed0ebf StopContainer(): ignore one more conmon warning
Resolves: #18865

[NO NEW TESTS NEEDED] -- it's a flake

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-22 05:02:19 -06:00
bd69b151fa run,create: modify --env-merge behavior for non-existent vars
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-06-22 15:42:55 +05:30
614c962c23 use libnetwork/slirp4netns from c/common
Most of the code moved there so if from there and remove it here.

Some extra changes are required here. This is a bit of a mess. The pipe
handling makes this a bit more difficult.

[NO NEW TESTS NEEDED] This is just a rework, existing tests must pass.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-22 11:16:13 +02:00
180cf0cf17 update c/common to latest
includes the slirp4netns package

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-22 11:15:48 +02:00
423b921308 Merge pull request #18964 from cevich/renovate_golang_ci_lint
[CI:BUILD] Help Renovate manage the golangci-lint version
2023-06-22 11:05:49 +02:00
dad875e66a Merge pull request #18965 from edsantiago/foodevdir_begone
e2e: use parallel-safe /dev subdirectories
2023-06-22 10:55:27 +02:00
12e560f68f Merge pull request #18963 from edsantiago/timeout_show_locks
systests: test instrumentation
2023-06-22 10:16:37 +02:00
d0af5df893 e2e: use parallel-safe /dev subdirectories
Replace /dev/foodevdir with unique paths, to avoid one
test's RemoveAll() from stepping on another test.

Closes: #18958

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-21 13:43:19 -06:00
aeff58e0b8 [CI:BUILD] Help Renovate manage the golangci-lint version
It's a bit cumbersome to manage a tooling version buried deep in a
command, let alone one also buried deep in a `Makefile`.  Add a
variable to hold the version number so renovate can easily manage it.
This happens via a `regex` manager in the shared configuration
include `containers/automation//renovate/defaults.json5`.  Also add a
helpful note/reminder to humans who may want to manually change the
version for some reason.

Depends on: https://github.com/containers/automation/pull/145

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-06-21 15:16:01 -04:00
dba9283269 Merge pull request #18954 from vrothberg/fix-15828
compat API create/pull/push: fix error handling
2023-06-21 19:43:58 +02:00
00292ae1c4 systests: test instrumentation
for #18514: if we get a timeout in teardown(), run and show
the output of podman system locks

for #18831: if we hit unmount/EINVAL, nothing will ever work
again, so signal all future tests to skip.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-21 11:12:32 -06:00
80dddd2a24 Merge pull request #18959 from edsantiago/logs_l_flake
e2e: fix one of the many log flakes
2023-06-21 18:09:08 +02:00
5f9920ccf2 Merge pull request #18948 from edsantiago/getsafe_comment
e2e: GetSafeIPAddress(): discourage its use
2023-06-21 17:34:58 +02:00
692c35f06d Merge pull request #18961 from Luap99/hosts-resolv
libpod: write /etc/{hosts,resolv.conf} once
2023-06-21 17:32:22 +02:00
71b0168b53 Merge pull request #18940 from giuseppe/add-compression-level
cmd, push: expose --compression-level
2023-06-21 16:37:30 +02:00
63dfe842bb compat API create/pull: fix error handling
Make sure that the create endpoint does not always return 200 even in
case of a failure.  Some of the code had to be massaged since encoding a
report implies sending a 200.

Fixes: #15828
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-21 16:37:27 +02:00
d545418945 compat API push: fix error handling
Make sure that the push endpoint does not always return 200 even in case
of a push failure.  Some of the code had to be massaged since encoding a
report implies sending a 200.

Fixes: #18751
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-21 16:35:55 +02:00
2c8b679215 Merge pull request #18956 from vrothberg/fix-18951
compat API container create: handle platform parameter
2023-06-21 16:19:12 +02:00
26721b0a06 GetSafeIPAddress(): discourage its use
Add header comment suggesting podman network create instead.

Stop using it in checkpoint tests. Turned out to be much more
complicated than expected.

Also, fix two issues caught while scanning the code:
 - remove obsolete f28-and-earlier code.
 - remove seccomp workaround needed for RHEL7

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-21 07:47:00 -06:00
810c97bd85 libpod: write /etc/{hosts,resolv.conf} once
My PR[1] to remove PostConfigureNetNS is blocked on other things I want
to split this change out. It reduces the complexity when generating
/etc/hosts and /etc/resolv.conf as now we always write this file after
we setup the network. this means we can get the actual ip from the netns
which is important.

[NO NEW TESTS NEEDED] This is just a rework.

[1] https://github.com/containers/podman/pull/18468

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-21 15:33:42 +02:00
13db83a000 e2e: fix one of the many log flakes
A few tests were doing "podman run -d" + "podman logs".
This is racy. Remove the unnecessary "-d".

And, as long as we're mucking around in here:
 - remove the "-t" from the 800-lines test, so we get
   clean output without ^Ms
 - remove unnecessary "sh", "-c" from simple echo commands
 - add actual error-message checks to two places that
   were only checking exit status

Resolves one (not all) of the flakes tracked in #18501

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-21 06:58:05 -06:00
b71f74c372 Merge pull request #18955 from BlackHole1/remove-hard-code
refactor(machine): remove hard code
2023-06-21 14:53:20 +02:00
bb932cc840 cmd, push: expose --compression-level
This patch adds the --compression-level option to the push command.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-21 14:28:16 +02:00
459248337b vendor: bump containers/common
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-21 14:28:16 +02:00
f4c514bffd compat API container create: handle platform parameter
The platform parameter has been ignored such that images have been
looked up by name only.

Fixes: #18951
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-21 14:19:23 +02:00
04a1cdfa96 refactor(machine): remove hard code
Use exported variables instead of hard-coded strings.

Ref: https://github.com/containers/common/pull/1516

Signed-off-by: Black-Hole1 <bh@bugs.cc>
2023-06-21 18:49:12 +08:00