Commit Graph

23615 Commits

Author SHA1 Message Date
Ed Santiago 48aea083c0 700-play.bats: refactor clumsy yamlfile creation
Remnant from the very early days of this test file. There's
a boilerplate $testYaml string used in many tests; each
use requires three clunky lines of prep. Most of those
were not needed; we can (and now do) use _write_test_yaml()
instead.

There are still two instances that could not be fixed in
this commit. I will do those next. This commit is kept
relatively simple for ease of review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
Ed Santiago 517c6e6f10 700-play.bats: move _write_test_yaml up near top
This is almost a NOP; it's needed for making subsequent commits
reviewable.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-17 18:24:07 -06:00
renovate[bot] ed71000e6d
chore(deps): update dependency setuptools to v71
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 22:13:43 +00:00
benniekiss 3c52ef43f5 Expand drop-in search paths
* top-level (pod.d)
* truncated (unit-.container.d)

Signed-off-by: Bennie Milburn-Town <63211101+benniekiss@users.noreply.github.com>
2024-07-17 17:43:02 -04:00
openshift-merge-bot[bot] 89432899a7
Merge pull request #23299 from containers/renovate/github.com-rootless-containers-rootlesskit-v2-2.x
fix(deps): update module github.com/rootless-containers/rootlesskit/v2 to v2.2.0
2024-07-17 20:26:50 +00:00
openshift-merge-bot[bot] 9f47319a72
Merge pull request #23137 from rhatdan/image
Do not crash on invalid filters
2024-07-17 16:45:30 +00:00
Daniel J Walsh 5666100c2e
Remove references and checks for --gpus
No way to test this unless running on a nvidia platform.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 12:02:51 -04:00
Daniel J Walsh 1ec3edd3f6
Do not crash on invalid filters
Vendor in latest containers/common
Fixes #23120

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-17 10:44:55 -04:00
renovate[bot] 692d2a5b08
fix(deps): update module github.com/rootless-containers/rootlesskit/v2 to v2.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-17 04:11:53 +00:00
openshift-merge-bot[bot] 555763c2a5
Merge pull request #23280 from edsantiago/bats-safename
System tests: safe container/image/volume/etc names
2024-07-16 18:01:13 +00:00
openshift-merge-bot[bot] e225cae781
Merge pull request #23145 from afbjorklund/remove-machine-volume-driver
Remove the unused machine volume-driver
2024-07-15 20:36:19 +00:00
Anders F Björklund f3e945c86e Keep the volume-driver flag deprecated
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2024-07-15 21:41:34 +02:00
openshift-merge-bot[bot] 07f0e4fe04
Merge pull request #23278 from rhatdan/VENDOR
Vendor in latest containers(common, storage,image, buildah)
2024-07-15 19:19:23 +00:00
Daniel J Walsh eb750f61f6
Vendor in latest containers(common, storage,image, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-07-15 13:51:43 -04:00
Ed Santiago b28027148b System tests: safe container/image/volume/etc names
Many system tests use hardcoded names for containers, images,
and everything. This has worked because system tests run
serially. It will not work if we ever run in parallel.

Create a new safename() helper, and use it as follows:

   myctr=c_$(safename)
   myvol1=v1_$(safename)
   ...

Find current instances of hardcoded names, and replace
with safe ones.

Whether or not we ever end up parallelizing system tests,
this is simply good practice.

There are far too many instances to fix in one (reviewable) PR.
This is commit 1 of N.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-15 11:38:00 -06:00
Arthur Sengileyev d26f0ca90f Implement disable default mounts via command line
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2024-07-15 15:27:19 +03:00
openshift-merge-bot[bot] 88c68a4b58
Merge pull request #23271 from giuseppe/drop-unmount-for-overlay-storage
test: podman system service doesn't leak mount on termination
2024-07-15 12:20:11 +00:00
openshift-merge-bot[bot] 2f673aa8f7
Merge pull request #23258 from Luap99/start-error
fix race conditions in start/attach logic
2024-07-15 12:11:56 +00:00
openshift-merge-bot[bot] 1d7439eb06
Merge pull request #23270 from passcod/patch-1
Add NetworkAlias= support for quadlet .container and .pod files
2024-07-15 10:29:14 +00:00
Giuseppe Scrivano b08b630c84
test: drop unmount for overlay
The unmount for the driver home dir is done automatically by the store
on Shutdown.  Do not do the unmount from the tests cleanup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano e16e528f39
test: gracefully terminate server
send a SIGTERM to the server process instead of killing it so it has
time to do a proper cleanup and don't leak the home mount.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano fbc4768a00
libpod: shutdown Stop waits for handlers completion
wait for handlers currently being processed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Giuseppe Scrivano 6832a35f65
libpod: cleanup store at shutdown
shutdown the containers store so that the home directory mount is not
leaked when "podman system service" exits.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-15 11:41:28 +02:00
Félix Saparelli 54fce37968
Add NetworkAlias= support to quadlet
Adds a `NetworkAlias=` key to both .container and .pod quadlet files,
which translates to the `--network-alias` option to `podman run` and
`podman pod create` respectively. Can be repeated multiple times.

Signed-off-by: Félix Saparelli <felix@passcod.name>
2024-07-15 16:39:25 +12:00
Giuseppe Scrivano 317a88ee4e
cmd: call shutdown handler stop function
it is needed to wait for the handlers if they are currently being processed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-14 20:06:46 +02:00
openshift-merge-bot[bot] 42fa78b225
Merge pull request #23259 from giuseppe/vendor-storage-ab74785ce9e8
vendor: bump c/storage
2024-07-12 14:32:46 +00:00
openshift-merge-bot[bot] feb5cf8388
Merge pull request #23197 from Luap99/docker-27
vendor: update to docker 27
2024-07-12 13:51:07 +00:00
openshift-merge-bot[bot] e62c928642
Merge pull request #23074 from marinmo/podman-compose-providerfix
Make podman-compose refer to podman-compose(1) when using an external provider
2024-07-12 13:48:33 +00:00
Paul Holzinger 3280da0500
fix race conditions in start/attach logic
The current code did something like this:
lock()
getState()
unlock()

if state != running
  lock()
  getState() == running -> error
  unlock()

This of course is wrong because between the first unlock() and second
lock() call another process could have modified the state. This meant
that sometimes you would get a weird error on start because the internal
setup errored as the container was already running.

In general any state check without holding the lock is incorrect and
will result in race conditions. As such refactor the code to combine
both StartAndAttach and Attach() into one function that can handle both.
With that we can move the running check into the locked code.

Also use typed error for this specific error case then the callers can
check and ignore the specific error when needed. This also allows us to
fix races in the compat API that did a similar racy state check.

This commit changes slightly how we output the result, previously a
start on already running container would never print the id/name of the
container which is confusing and sort of breaks idempotence. Now it will
include the output except when --all is used. Then it only reports the
ids that were actually started.

Fixes #23246

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-12 15:11:34 +02:00
openshift-merge-bot[bot] 2415b4f3d7
Merge pull request #23257 from giuseppe/fix-pass-pull-option
contrib: use a distinct --pull-option= for each flag
2024-07-12 12:45:45 +00:00
Paul Holzinger 04fb77efe2
swagger: exlude new docker network types
The new docker types have conflicting swagger:model names, there is both
network.CreateResponse and container.CreateResponse. However both have
a different fields (Warning and Warnings) and both are marked as
required. The swagger generate sees both and somehow merges them but
then only shows fields from one type but at the same time list all
fields as required. This causes the swagger validation to fail:
- "Warning" is present in required but not defined as property in definition "CreateResponse"

To work around that we exlcude the netwok types from the swagger
generation which makes it work again. Looking at the final type info in
the browser it still shows the type onfo on the compat network endpints
so it doesn't even loose any valuable information AFAICS.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-12 14:19:37 +02:00
Giuseppe Scrivano f90bd48859
vendor: bump c/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-12 14:19:33 +02:00
Paul Holzinger e24367aa14
update to docker 27
Fixes compile issues with new docker changes, then fix all the new
depreciation warnings.
Also there seem to be larger pre-existing problems with the
/containers/json API output as the HostConfig field seems to be missing
but I don't have time to deal with that currently.

Note this does not include changes for the new docker API 1.46.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-12 14:00:29 +02:00
Giuseppe Scrivano b1e535b911
contrib: use a distinct --pull-option= for each flag
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-07-12 12:51:39 +02:00
marinmo 02af4f8bd6 Update warning message when using external compose provider
Change the warning message at runtime to refer to the man page of podman-compose instead of "the documentation"

Add instructions in the man page on how to disable the warning emitted by podman-compose when using an external compose provider

Signed-off-by: marinmo <bugzilla@marinmo.org>
2024-07-12 07:12:32 +02:00
openshift-merge-bot[bot] 360c4f372d
Merge pull request #23234 from Luap99/test-nftables
test netavark nftables driver
2024-07-11 22:19:32 +00:00
openshift-merge-bot[bot] 04bd415c74
Merge pull request #23167 from mheon/fix_rhel_37948
Ignore result of EvalSymlinks on ENOENT
2024-07-11 20:13:02 +00:00
openshift-merge-bot[bot] fe65b5873f
Merge pull request #23251 from containers/renovate/github.com-cyphar-filepath-securejoin-0.x
Update module github.com/cyphar/filepath-securejoin to v0.3.0
2024-07-11 18:34:16 +00:00
renovate[bot] 7c775a3f4c
Update module github.com/cyphar/filepath-securejoin to v0.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-11 15:41:50 +00:00
Matt Heon 830e550073 Ignore result of EvalSymlinks on ENOENT
When the path does not exist, filepath.EvalSymlinks returns an
empty string - so we can't just ignore ENOENT, we have to discard
the result if an ENOENT is returned.

Should fix Jira issue RHEL-37948

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-07-11 09:39:56 -04:00
openshift-merge-bot[bot] 58c8803a1e
Merge pull request #22726 from edsantiago/pull-from-local-registry
CI: Use local cache registry
2024-07-11 12:42:04 +00:00
Paul Holzinger 926547f7d3
test/upgrade: fix tests when netavark uses nftables
Old netavark version only supported iptables, however a new version on
th ehost might use nftables. This breaks the networking tests here as
they are not compatible and you would need to reboot to fix that.

Because this is not possible for our tests make sure we force the
iptables driver always to keep the test working.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:10:16 +02:00
Paul Holzinger 5856adb9f8
test/system: fix network reload test with nftables
netavark can use iptables or nftables as firewall driver, thus if we try
to flush rules make sure we try both to keep the test working when we
switch the default to nftables.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:09:59 +02:00
Paul Holzinger c4b2015e3a
test/e2e: rework some --expose tests
Stop using iptables to check anything, it does not work rootless and
will no longer work with nftables which will be used in the future.

Also fix up the test that say podman run to actually use podman run and
then just check via inspect that the ports are set correctly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:08:28 +02:00
Paul Holzinger 9945981afb
test: remove publish tests from e2e
This test checks a simple publish which is already covered in many other
places, it also used iptables wich is a invalid assumption going forward
as we start to enable nftables as firewall driver.

The only thing these tests added where checking that we cannot resuse
the same port. Given there was more than one kernel regression[1,2]
about correctly failing with EADDRINUSE I also added the
distro-integration tag to make sure we catch this early in fedora
testing.

[1] https://lore.kernel.org/regressions/e21bf153-80b0-9ec0-15ba-e04a4ad42c34@redhat.com/
[2] https://lore.kernel.org/regressions/CAFsF8vL4CGFzWMb38_XviiEgxoKX0GYup=JiUFXUOmagdk9CRg@mail.gmail.com/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:08:28 +02:00
Paul Holzinger 43f6173cc6
CI: test nftables driver on fedora
Make sure this passes podman CI before we push out a default change.

ref: https://fedoraproject.org/wiki/Changes/NetavarkNftablesDefault

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-07-11 14:08:27 +02:00
openshift-merge-bot[bot] e570aacc4e
Merge pull request #23212 from l0rd/vs-buildtools
Using Visual Studio BuildTools as a MinGW alternative
2024-07-11 11:25:03 +00:00
openshift-merge-bot[bot] 1125d4d143
Merge pull request #23228 from Luap99/fix-internal-test
test/system: fix pasta host.containers.internal test
2024-07-11 11:22:20 +00:00
Ed Santiago 07b69943a4 CI: use local registry, part 3 of 3: for developers
New tool, get-local-registry-script, intended for developers
to get a local registry running in their environment. This is
not necessary for any tests, but may be desirable for performance
reasons and/or to recreate the CI environment.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-11 04:39:45 -06:00
Ed Santiago dd1bcabae9 CI: use local registry, part 2 of 3: fix tests
This commit gets tests working under the new local-registry system:

  * amend a few image names, mostly just sticking to a consistent
    list of those images in our registry cache. Mostly minor
    tag updates.

  * trickier: pull_test: change some error messages, and remove
    a test that's now a NOP. Basically, with a local (unprotected)
    registry we always get "404 manifest unknown"; with a real
    registry we'll get "403 I can't tell you".

  * trickiest: seccomp_test: build our own images at run time,
    with our desired labels. Until now we've been pulling
    prebuilt images, but those will not copy to the local
    cache registry. Something about v1? Anyhow, I gave up
    trying to cache them, and the workaround is straightforward.

Also took the liberty of strengthening a few error-message checks

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-07-11 04:39:45 -06:00