Commit Graph

19318 Commits

Author SHA1 Message Date
Paul Holzinger f64a1a1cc8
rootless: use default_rootless_network_cmd config
Make sure we use the config field to know if we should use pasta or
slirp4netns as default.

While at it fix broken code which sets the default at two different
places, also do not set in Validate() as this should not modify the
specgen IMO, so set it directly before that.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-29 09:46:25 +02:00
OpenShift Merge Robot 9067d5c85e
Merge pull request #19013 from dfr/emulate-linux
pkg/specgen: Add support for Linux emulation on FreeBSD
2023-06-28 14:50:07 +02:00
OpenShift Merge Robot be49741dc7
Merge pull request #19021 from dgibson/bug19007
pasta: Fix pasta tests to work on hosts with multiple interfaces
2023-06-28 13:06:43 +02:00
OpenShift Merge Robot c8b9c29113
Merge pull request #19019 from BlackHole1/fix-windows-docs
[CI:DOCS] fix command incorrect in windows
2023-06-28 12:30:19 +02:00
OpenShift Merge Robot 6babf9492d
Merge pull request #19015 from rhatdan/read-only
Fix readonly=false failure
2023-06-28 07:56:58 +02:00
OpenShift Merge Robot f739f8f990
Merge pull request #18921 from fangpenlin/fix-18907-set-correct-cwd-for-poststop-hook-exe
Fixes #18907, pass in correct cwd value for hooks exe
2023-06-28 07:51:52 +02:00
David Gibson fe8355be7f pasta: Fix pasta tests to work on hosts with multiple interfaces
At various points the pasta bats tests need to know the name of the
interface that pasta will use by default, and the host addresses it will
use by default.  Currently we use the pre-existing helper functions
ether_get_name and ipv[46]_get_addr_global to retreive that.

However, those just pick the first non-loopback interface or address, which
may not be the one that pasta uses if there are multiple connected host
interfaces.

Replace those helpers with local ones which examine the routing table to
more closely match pasta's internal logic about which interface to select.
This allows the tests to run successfully on a host with multiple
interfaces.

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

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-06-28 13:12:33 +10:00
Black-Hole1 d15cca0246
[CI:DOCS] fix command incorrect in windows
Signed-off-by: Black-Hole1 <bh@bugs.cc>
2023-06-28 09:23:51 +08:00
Daniel J Walsh bcb89fc8b2
Fix readonly=false failure
There was a huge cut and paste of mount options which were not constent
in parsing tmpfs, bind and volume mounts.  Consolidated into a single
function to guarantee all parse the same.

Fixes: https://github.com/containers/podman/issues/18995

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 16:57:21 -04:00
OpenShift Merge Robot 4dc2e08618
Merge pull request #18977 from jakecorrenti/move-qemu-functions-to-proper-files
Re-organize hypervisor implementations
2023-06-27 22:09:21 +02:00
OpenShift Merge Robot 089dbed498
Merge pull request #18999 from Luap99/vendor
update c/{common,image,storage,buildah} to latest
2023-06-27 21:10:58 +02:00
OpenShift Merge Robot c928da6d67
Merge pull request #18975 from rhatdan/man
Kube quadlets can support autoupdate as well as containers
2023-06-27 19:52:09 +02:00
OpenShift Merge Robot 1aacafbe1e
Merge pull request #18984 from rhatdan/podmansh
[CI:DOCS] Fix up podmansh man page
2023-06-27 19:46:56 +02:00
Doug Rabson 609c47ae6c pkg/specgen: Add support for Linux emulation on FreeBSD
This is limited to images that don't depend on complex cgroup or capability
setups but does cover enough functionality to be useful.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-27 17:36:28 +01:00
Daniel J Walsh cf9ebcddfd
Fix up podmansh man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 12:05:24 -04:00
Daniel J Walsh 05eb3e6f13
Make Podman/Buildah use same DecryptConfig/EncryptConfig funcs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 18:04:42 +02:00
Ed Santiago f5cc0487e8
Fixes for vendoring Buildah
This commit was automatically cherry-picked
by buildah-vendor-treadmill v0.3
from the buildah vendor treadmill PR, #13808

Changes since 2023-05-01:
  - skip a new test, it fails in remote
  - skip encrypted-FROM test, broken by buildah PR 4746

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 18:04:42 +02:00
Paul Holzinger 0f4c86e267
vendor in latest buildah
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 18:04:42 +02:00
Paul Holzinger 6eaf8a271d
tests: fix "Storing signatures" check
After[1] c/image no longer prints "Storing signatures" so we should
not check for it.

[1] https://github.com/containers/image/pull/2001

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 18:04:42 +02:00
Paul Holzinger b80fd54a56
update c/image and c/storage to latest
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 18:04:42 +02:00
Daniel J Walsh eeb7aeb496
Kube quadlets can support autoupdate as well as containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 11:20:14 -04:00
OpenShift Merge Robot 4445a5040a
Merge pull request #19008 from Luap99/800lines-flake
debug tail 800 lines flake
2023-06-27 16:44:43 +02:00
Paul Holzinger 2160a114cc
debug tail 800 lines flake
Sometimes this tests flakes but in the CI log I see all expected lines
printed but still for some reason the matcher fails.
Right now it will truncate the array so it is not possible to verify
what the matcher sees. Change this be removing the truncate limit for
this specific test only.

see #18501

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-27 14:58:27 +02:00
Fang-Pen Lin dd81f7ac61
Pass in correct cwd value for hooks exe
Signed-off-by: Fang-Pen Lin <hello@fangpenlin.com>
2023-06-26 23:49:08 -07:00
OpenShift Merge Robot 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
OpenShift Merge Robot c2d46acdea
Merge pull request #18980 from vrothberg/bz-2216700
make image listing more resilient
2023-06-26 22:42:37 +02:00
OpenShift Merge Robot 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
OpenShift Merge Robot 6a742cb2f5
Merge pull request #18981 from rhatdan/quadlet
Trim whitespace from unit files while parsing
2023-06-26 22:29:42 +02:00
Giuseppe Scrivano 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
Giuseppe Scrivano 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
Valentin Rothberg 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
OpenShift Merge Robot 3a013b6256
Merge pull request #18998 from edsantiago/bats_prefetch
system tests: add and use _prefetch
2023-06-26 16:08:45 +02:00
Ed Santiago 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
renovate[bot] 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
OpenShift Merge Robot 1bca2d6a1e
Merge pull request #18983 from Luap99/api-top
pkg/api: top return error to client
2023-06-26 08:12:29 +02:00
Daniel J Walsh 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
OpenShift Merge Robot 384638861b
Merge pull request #18978 from rhatdan/man1
[CI:DOCS] Fix example on PublishPort
2023-06-23 20:57:22 +02:00
OpenShift Merge Robot 9f4ee47dc4
Merge pull request #18932 from lsm5/packit-cleanup
[CI:BUILD] Packit: cleanups
2023-06-23 17:49:31 +02:00
Jake Correnti 516034215f Re-organize hypervisor implementations
Ensures that for each hypervisor implementation, their `config.go` file
deals with implementing the `VirtProvider` interface while the
`machine.go` file is for implementing the `VM` interface.

Moves the `Virtualization` type into a common file and
created wrappers for the individual hypervisors. Allows for shared
functions that are exactly the same while providing the flexibility to
create hypervisor-specific implementations of the functions.

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-06-23 11:33:19 -04:00
Paul Holzinger 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
Paul Holzinger 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
OpenShift Merge Robot 84454987f5
Merge pull request #18974 from vrothberg/fix-13627
podman wait: support healthy/unhealthy
2023-06-23 16:03:50 +02:00
Valentin Rothberg 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
Daniel J Walsh b680daa2de
[CI:DOCS] Fix example on PublishPort
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-23 06:47:05 -04:00
Valentin Rothberg 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
Valentin Rothberg 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
OpenShift Merge Robot 49e0bde2bf
Merge pull request #18946 from Luap99/slirp4netns
use slirp4netns code from c/common
2023-06-22 16:15:18 +02:00
OpenShift Merge Robot 436df1ba1f
Merge pull request #18971 from edsantiago/silence_esrch
StopContainer(): ignore one more conmon warning
2023-06-22 16:10:07 +02:00
OpenShift Merge Robot 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
Ed Santiago 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