Commit Graph

6094 Commits

Author SHA1 Message Date
Ygal Blum 212b4c9e93 Quadlet .pod - add support for the Network Key
Add e2e tests
Update documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-12-03 10:22:33 +02:00
Matt Heon f384bdf66b Handle symlinks when checking DB vs runtime configs
When Podman starts, it checks a number of critical runtime paths
against stored values in the database to make sure that existing
containers are not broken by a configuration change. We recently
made some changes to this logic to make our handling of the some
options more sane (StaticDir in particular was set based on other
passed options in a way that was not particularly sane) which has
made the logic more sensitive to paths with symlinks. As a simple
fix, handle symlinks properly in our DB vs runtime comparisons.

The BoltDB bits are uglier because very, very old Podman versions
sometimes did not stuff a proper value in the database and
instead used the empty string. SQLite is new enough that we don't
have to worry about such things.

Fixes #20872

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-12-02 15:48:47 -05:00
openshift-merge-bot[bot] bc124dd13f
Merge pull request #20819 from cgiradkar/20752_farm_flag_move
Move the --farm flag to farm build command
2023-12-01 21:12:38 +00:00
openshift-merge-bot[bot] c47962802a
Merge pull request #20657 from nalind/commit-config
RHEL-14922: accept a config blob alongside the "changes" slice when committing
2023-12-01 21:09:23 +00:00
openshift-merge-bot[bot] 3b03e85471
Merge pull request #20789 from umohnani8/healthcheck
Don't update health check status during initialDelaySeconds
2023-12-01 13:12:50 +00:00
renovate[bot] 269f8ff066
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-30 14:53:34 +00:00
Chetan Giradkar 31df9c237e Move the --farm flag to farm build command
The option `farm` which is used to specify the farm to be used, is moved to farm build command from farm command.

closes #20752

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-30 14:27:06 +00:00
Nalin Dahyabhai 426db6fcc1 Accept a config blob alongside the "changes" slice when committing
When committing containers to create new images, accept a container
config blob being passed in the body of the API request by adding a
Config field to our API structures.  Populate it from the body of
requests that we receive, and use its contents as the body of requests
that we make.

Make the libpod commit endpoint split changes values at newlines, just
like the compat endpoint does.

Pass both the config blob and the "changes" slice to buildah's Commit()
API, so that it can handle cases where they overlap or conflict.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:00:52 -05:00
Ed Santiago f95dd21d5d deferred test failures: handle a corner case
Followup to #20797 (defer assertion failures). The bail-now()
helper was being defined only in setup() ... and some tests,
particularly 001-basic.bats, define their own minimalist setup().

Symptom was "bail-now: command not found", which still caused
test to fail (so no failures were hidden) but led to concern
and wasted time when analyzing failures.

Solution: add one more definition of bail-now(), in outer scope.

There is still one pathological case I'm not addressing: a
bats file that defines its own teardown() which does not invoke
basic_teardown(), then has a test that runs defer-assertion-failures
without a followup immediate-assertion-failures. This would lead
to failures that are never seen. Since teardown() without basic_teardown()
is invalid, I choose not to worry about this case.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-30 06:33:46 -07:00
openshift-merge-bot[bot] 572a7692e3
Merge pull request #20828 from alexlarsson/quadlet-snippets
quadlet: Support systemd style dropin files
2023-11-29 23:24:33 +00:00
Ed Santiago 3e70415089 Gating test fixes
Two newly-added tests, fail in gating:
 - system connection: difference in how sockets are set up
   between CI and gating
 - ulimit: gating seems to run with ulimit -c -H 0. Check, and
   skip if ulimit is less than what we need

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-29 07:51:43 -07:00
Urvashi Mohnani f35d1c1c25 Don't update health check status during initialDelaySeconds
When InitialDelaySeconds in the kube yaml is set for a helthcheck,
don't update the healthcheck status till those initial delay seconds are over.
We were waiting to update for a failing healtcheck, but when the healthcheck
was successful during the initial delay time, the status was being updated as healthy
immediately.
This is misleading to the users wondering why their healthcheck takes
much longer to fail for a failing case while it is quick to succeed for
a healthy case. It also doesn't match what the k8s InitialDelaySeconds
does. This change is only for kube play, podman healthcheck run is
unaffected.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-11-29 08:37:39 -05:00
Alexander Larsson 8ee2622028 quadlet: Support systemd style dropin files
For a source file like `foo.container`, look for drop in named
`foo.container.d/*.conf` and merged them into the main file.  The
dropins are applied in alphabetical order, and files in earlier
diretories override later files with same name.

This is similar to how systemd dropins work, see:
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

Also adds some tests for these

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2023-11-29 13:46:52 +01:00
openshift-merge-bot[bot] 6d9d8f06ce
Merge pull request #20517 from rhatdan/mask
Get masked paths and readonly masked patchs from containers/common @rhatdan
2023-11-29 02:12:37 +00:00
openshift-merge-bot[bot] 21951e2376
Merge pull request #20799 from edsantiago/symlink-mounts
[systests] podman mount no-dereference: complete rewrite
2023-11-29 01:14:48 +00:00
openshift-merge-bot[bot] 83c08a2f5c
Merge pull request #20609 from cgiradkar/19124_remove_event_fix
Set correct exitcode in remove events
2023-11-28 16:21:17 +00:00
openshift-merge-bot[bot] 545daed1e4
Merge pull request #20762 from ygalblum/quadlet-pod
Quadlet - Add support for .pod units
2023-11-28 14:44:00 +00:00
Chetan Giradkar 572f38c0db Set correct exitcode in remove events and change ContainerExitCode from int to int ptr
Added additional check for event type to be remove and set the correct exitcode.
While it was getting difficult to maintain the omitempty notation for Event->ContainerExitCode, changing the type from int to int ptr gives us the ability to check for ContainerExitCode to be not nil and continue operations from there.

closes #19124

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-28 13:31:18 +00:00
Ygal Blum 6b2f48129e Quadlet - Add support for .pod units
Add support for .pod unit files with only PodmanArgs, GlobalArgs, ContainersConfModule and PodName
Add support for linking .container units with .pod ones
Add e2e and system tests
Add to man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-28 14:31:53 +02:00
Ed Santiago c664cfe886 [systests] podman mount no-dereference: complete rewrite
Existing test was very good, but as a multidimensional table it
was unmaintainable... and actually missed one corner case.

This version isn't much better. It's far longer, codewise. It
is a little harder to understand at first glance. It has three
uncomfortable magic conditionals. But I believe it is more
long-term maintainable: beyond the first glance, it is possible
for a human to check it for correctness. It is also extensible,
as proved by the new test cases I added.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-28 04:45:51 -07:00
openshift-merge-bot[bot] 720a0ead3a
Merge pull request #20797 from edsantiago/defer_assert_failures
[systests] new defer-assertion-failure
2023-11-28 10:56:56 +00:00
renovate[bot] 07a7b3ae5d
fix(deps): update module golang.org/x/tools to v0.16.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 01:59:00 +00:00
Ed Santiago 29d18079cb [systests] new defer-assertion-failure
Some system tests run deep loops:

  for x in a b c; do
    for y in d e f; do
        .... check condition $x + $y

Normally, if one of these fails, game over. This can be frustrating
to a developer looking for failure patterns.

Here we introduce a new defer-assertion-failure function, meant
to be called before loops like these. Everything is the same,
except that tests will continue running even after failure.

When test finishes, or if test runs immediate-assertion-failure,
a new message indicates that multiple tests failed:

  FAIL: X test assertions failed. Search for 'FAIL': above this line.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-27 11:31:29 -07:00
Paul Holzinger d280e481a5
test/compose: remove debug leftovers
I noticed these old debug code while looking at a log. These were
needed to debug a nasty flake[1] in the compose tests. However
it has been fixed[2] for a while and I am not aware of any flakes
around that logic so we are good to remove it.

I still leave the server logs in there as they may be useful for all
kinds of issues and are only printed when the test fails so it does not
clutter the logs.

[1] https://github.com/containers/podman/issues/10052
[2] https://github.com/containers/podman/pull/11091

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-27 18:02:26 +01:00
openshift-merge-bot[bot] 1486ee5189
Merge pull request #20744 from rhatdan/pod
If API calls for kube play --replace, then replace pod
2023-11-25 13:46:56 +00:00
openshift-merge-bot[bot] b4eb88fca4
Merge pull request #20746 from rhatdan/selinux
Ignore SELinux relabel on unsupported file systems
2023-11-23 01:11:02 +00:00
Daniel J Walsh 75638a72a8
If API calls for kube play --replace, then replace pod
Currently if user specifies podman kube play --replace, the
pod is removed on the client side, not the server side.  If
the API is called with replace=true, the pod was not being removed
and this called the API to fail. This PR removes the pod if it
exists and the caller specifies replace=true.

Fixes: https://github.com/containers/podman/discussions/20705

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-22 13:31:24 -05:00
openshift-merge-bot[bot] 2f160f850f
Merge pull request #20714 from deuill/quadlet-notify-healthy
quadlet: Support `healthy` for `Notify` directives
2023-11-22 15:52:29 +00:00
Daniel J Walsh ddd6cdfd77
Ignore SELinux relabel on unsupported file systems
We were ignoreing relabel requests on certain unsupported
file systems and not on others, this changes to consistently
logrus.Debug ENOTSUP file systems.

Fixes: https://github.com/containers/podman/discussions/20745

Still needs some work on the Buildah side.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-22 09:25:38 -05:00
Alex Palaistras 6cb2f9b122 quadlet: Support `healthy` for `Notify` directives
This expands support for the (previously) boolean `Notify` directive, in
support of healthcheck determined SD-NOTIFY event emission, as
supported by Podman with the `--sdnotify=healthy` option.

Closes: #18189
Signed-off-by: Alex Palaistras <alex@deuill.org>
2023-11-21 18:08:48 +00:00
openshift-merge-bot[bot] ee5f582fbc
Merge pull request #20356 from vrothberg/RUN-1935
new 'no-dereference' mount option
2023-11-21 14:40:03 +00:00
openshift-merge-bot[bot] a6510d9310
Merge pull request #20725 from ashley-cui/updatemain
Bump main to 5.0.0-dev
2023-11-21 13:05:18 +00:00
Valentin Rothberg e40d70cecc new 'no-dereference' mount option
Add a new `no-dereference` mount option supported by crun 1.11+ to
re-create/copy a symlink if it's the source of a mount.  By default the
kernel will resolve the symlink on the host and mount the target.
As reported in #20098, there are use cases where the symlink structure
must be preserved by all means.

Fixes: #20098
Fixes: issues.redhat.com/browse/RUN-1935
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-11-21 13:17:58 +01:00
Ashley Cui be24633300 Bump to v5.0.0-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-20 15:10:17 -05:00
renovate[bot] e75fbe54e2
Update dependency setuptools to v69
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-20 18:13:43 +00:00
Daniel J Walsh 62060f3234
Get masked paths and readonly masked patchs from containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-19 10:01:20 -05:00
openshift-merge-bot[bot] 149d4f079a
Merge pull request #20161 from edsantiago/ci_desired_storage
CI: test overlay and vfs
2023-11-18 20:59:17 +00:00
Miloslav Trmač d0b32255e4 Add support for --compat-auth-file in login/logout
This mostly just inherits the c/common/pkg/auth implementation,
except that AuthFilePath and DockerCompatAuthFilePath can not be set
simultaneously, so don't unnecessarily explicitly set AuthFilePath.
c/common already handles that.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-17 16:44:06 +01:00
Miloslav Trmač a3d5814e0e Update tests for a c/common error message change
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-17 16:44:06 +01:00
Ed Santiago a10b88cb2f CI: test overlay and vfs
We're only testing vfs in CI. That's bad. #18822 tried to
remedy that but that only worked on system tests, not e2e.

Here we introduce CI_DESIRED_STORAGE, to be set in .cirrus.yml
in the same vein as all the other CI_DESIRED_X. Since it's 2023
we default to overlay, testing vfs only in priorfedora.

Fixes required:
 - e2e tests:
   - in cleanup, umount ROOT/overlay to avoid leaking mounts

 - system tests:
   - fix a few badly-written tests that assumed/hardcoded overlay
   - buildx test: add weird exception to device-number test
   - mount tests: add special case code for vfs
   - unprivileged test: disable one section that is N/A on vfs

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-17 05:48:50 -07:00
Ed Santiago d2a4ec867d Test fixes for debian
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-16 15:14:36 -07:00
Ed Santiago 23ead49dee pasta tests: remove some skips
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-16 15:14:36 -07:00
openshift-merge-bot[bot] 638199c495
Merge pull request #20671 from ygalblum/quadlet-uidmap
Quadlet - add support for UID and GID Mapping
2023-11-16 15:40:37 +00:00
Ygal Blum e35fc92c02 Quadlet - add support for UID and GID Mapping
Support UIDMap, GIDMap, SubUIDMap and SubGIDMap
If any of them are set disregard the deprecated Remap keys
Add tests and man

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-15 12:10:22 +02:00
Ygal Blum dc709e4d76 Quadlet - Allow using symlink on the base search paths
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-15 09:58:28 +02:00
Ed Santiago 047da19b5f (Temporary) Emergency CI fix: quay search is broken
Someone please revert this once quay search is fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-13 06:52:10 -07:00
openshift-merge-bot[bot] a3f8f8c1c3
Merge pull request #20652 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.1
2023-11-13 12:06:13 +00:00
openshift-merge-bot[bot] 8e6fe99fdb
Merge pull request #20662 from ygalblum/quadlet-mount-equal-sign
Quadlet test - add case for multi = sign in mount
2023-11-13 08:09:50 +00:00
Ygal Blum bd375058cf Quadlet test - add case for multi = sign in mount
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-11-12 10:10:42 +02:00
Ed Santiago 6b5b399121 CI: e2e: fix a smattering of test bugs that slipped in
...while Ed was napping:
 - create/run based on remote image: was not actually testing anything
 - create/run --tls-verify: ditto
 - run --decryption-key: sort of testing but not really
 - Fail(), not Skip(), if we can't start registry.
 - never Skip() halfway through a test: emit a message, and return

The Skip-in-the-middle thing deserves to be shouted from the rooftops.
Let's please never do that again. Skip() says "this entire test was
skipped", which can be misleading to a spelunker trying to track
down a problem related to those tests.

Also, more minor:
 - reduce use of port 5000
 - rename a confusingly-named test

Ref: #11205, #12009

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-10 13:41:34 -07:00
renovate[bot] d07263f348
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-10 18:31:35 +00:00
openshift-merge-bot[bot] bc7c01d195
Merge pull request #20638 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.15.0
2023-11-10 16:03:59 +00:00
openshift-merge-bot[bot] 7d107b9892
Merge pull request #19879 from rhatdan/ulimits
Support passing of Ulimits as -1 to mean max
2023-11-10 10:47:43 +00:00
renovate[bot] 5388836c11
fix(deps): update module golang.org/x/tools to v0.15.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 02:16:55 +00:00
openshift-merge-bot[bot] 01fd9e906b
Merge pull request #20620 from baude/codecleanup
Automatic code cleanups - JetBrains
2023-11-08 22:14:36 +00:00
openshift-merge-bot[bot] 6bb2edd215
Merge pull request #20608 from rhatdan/codespell
Run codespell on podman
2023-11-08 08:30:43 +00:00
Brent Baude 78798cab00 Automatic code cleanups - JetBrains
A bunch of cleanups as suggested by linters/etc in JetBrains IDE.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-07 14:05:15 -06:00
openshift-merge-bot[bot] 111b2337f9
Merge pull request #20613 from edsantiago/doublecheck_db
systests: add a last-minute check for db backend
2023-11-07 16:18:35 +00:00
Ed Santiago 1c969219d4 systests: add [NNN] prefix in logs, NNN = filename
This is something I've long wanted in logs: an indicator of
which bats file the test lives in. As of v1.7.0 there is
now a way to do that, BATS_TEST_NAME_PREFIX. Use it. Logs
now look like:

     ok 14 [001] podman - shutdown engines
     ok 15 [005] podman info - basic test
     ...
     not ok 195 [065] podman cp - dot notation ....

(As a bonus, we can remove the super-long "test blah blah pasta"
duplication from 505.bats).

Also, removed no-longer-necessary (fingers crossed) debug code
for the recently fixed containers-storage umount/EINVAL flake.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-06 14:45:45 -07:00
Ed Santiago 92cd7b25f2 systests: add a last-minute check for db backend
This will only fail if someone ever adds a system test that
runs podman with "--db-backend boltdb", which nobody should
ever do, but this is a cheap way to make sure it never happens.

See #20563

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-06 14:15:28 -07:00
Daniel J Walsh c2de6d34ca
Run codespell on podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-06 09:23:16 -06:00
Daniel J Walsh 420316ef6e
Podman push --help should reveal default compression
When using the local client, we should display the compression
algorithm.

If the compression level is set, then show this also.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-04 07:33:53 -05:00
openshift-ci[bot] b44d372b1b
Merge pull request #20559 from edsantiago/ci_default_sqlite
CI: default to sqlite
2023-11-03 18:56:29 +00:00
Aditya R 607aff55fa
remote,test: remove .dockerignore which is a symlink
It seems certain test infrastructure prevents cloning repo which
contains symlink outside of the repo itself, generate symlink for such
test by the testsuite itself just before running test and remove it when
test is completed.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-11-03 20:39:02 +05:30
Ed Santiago 2a17baa29d CI: default to sqlite
Followup to #20318: now that sqlite is the podman default,
enforce that in CI as well. Test boltdb only in Prior Fedora.

In the process, discovered & cleaned up some duplication
and unused YAML anchors.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-02 13:17:21 -06:00
Daniel J Walsh af0ef47f0c
Add status messages to podman --remote commit
Fixes: https://github.com/containers/podman/issues/19947

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-01 14:31:09 -04:00
openshift-ci[bot] f84dba2273
Merge pull request #20506 from edsantiago/farm_tests
CI: podman farm tests cleanup
2023-11-01 13:19:51 +00:00
Daniel J Walsh 18d6bb40d5
Support passing of Ulimits as -1 to mean max
Docker allows the passing of -1 to indicate the maximum limit
allowed for the current process.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-01 08:46:55 -04:00
openshift-ci[bot] 2972f5941f
Merge pull request #20545 from giuseppe/fix-hostname-with-host-uts
libpod: fix /etc/hostname with --uts=host
2023-10-31 14:05:52 +00:00
Giuseppe Scrivano b332ca7a02
libpod: fix /etc/hostname with --uts=host
when --uts=host is provided, the expectation is to use the hostname
from the host not the container name.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-31 13:02:17 +01:00
openshift-ci[bot] 4eb02346d5
Merge pull request #20536 from edsantiago/pasta_timeout_tweaks
systests: pasta: avoid hangs
2023-10-31 11:58:57 +00:00
openshift-ci[bot] 735e243319
Merge pull request #20539 from edsantiago/stty_flake
systests: stty test: retry once on flake
2023-10-31 07:55:49 +00:00
openshift-ci[bot] 377644640a
Merge pull request #20476 from rhatdan/build
podman build --remote URI Dockerfile should not be treated as file
2023-10-31 07:49:59 +00:00
Ed Santiago 89d7b27357 systests: stty test: retry once on flake
I've seen the stty flake (#10710) twice in one day. Time to
add a retry.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-30 19:13:30 -06:00
Ed Santiago 6b94c8fd31 systests: pasta: avoid hangs
Under some circumstances BATS tests hang, causing a CI timeout.

One prominent reason is pasta test failures: BATS will not
exit until all child processes are finished, and in some
environments the socat client can stay forever.

Workaround: run socat with a timeout, and with limited retries.

Tested on an f38 system with broken IPv6: without this fix,
bats hangs until I ^C. With this fix, bats exits as it should.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-30 12:53:05 -06:00
openshift-ci[bot] 4871182422
Merge pull request #20457 from rhatdan/pod
podman kube play --replace should force removal of pods and containers
2023-10-30 11:51:19 +00:00
openshift-ci[bot] 77d2658201
Merge pull request #20369 from cgiradkar/Issue-16759-docs
Define better error message for container name conflicts with external storage
2023-10-30 10:22:00 +00:00
Daniel J Walsh a1577ec7b0
podman build --remote URI Dockerfile shoud not be treated as file
Podman build --remote is translating https://path as if it was a file
path. This change will leave it as a URL so it can be parsed on the
server side.

Fixed: https://github.com/containers/podman/issues/20475

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 15:10:18 -04:00
openshift-ci[bot] 4f6a8f0d50
Merge pull request #20483 from vrothberg/RUN-1934
container.conf: support attributed string slices
2023-10-27 17:49:13 +00:00
Daniel J Walsh 91df369ae6
podman kube play --replace should force removal of pods and containers
Fixes: https://github.com/containers/podman/issues/20025

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 07:29:53 -04:00
Valentin Rothberg e966c86d98 container.conf: support attributed string slices
All `[]string`s in containers.conf have now been migrated to attributed
string slices which require some adjustments in Buildah and Podman.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-27 12:44:33 +02:00
openshift-ci[bot] 7d5af58bd7
Merge pull request #20501 from mheon/powercap
Mask /sys/devices/virtual/powercap
2023-10-27 08:04:52 +00:00
Ed Santiago 91ccd7cd2f CI: podman farm tests cleanup
Followup from #20050. Lots of tiny problems in tests, all of
them adding up to significant maintainability problems.

These tests are currently impossible to run in a dev environment,
and super-painful to set up in 1mt, so I've just done a few hours
of cleanup and am giving up for the week.

This is ready for merge, in the sense that it's much better than
what exists now, but it still needs boatloads more work.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 18:12:07 -06:00
Matthew Heon be7dd128ef Mask /sys/devices/virtual/powercap
I don't really like this solution because it can't be undone by
`--security-opt unmask=all` but I don't see another way to make
this retroactive. We can potentially change things up to do this
the right way with 5.0 (actually have it in the list of masked
paths, as opposed to adding at spec finalization as now).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-10-26 18:24:25 -04:00
Ed Santiago 9e3363c5e3 CI: systest: safer random_rfc1918_subnet
Our aarch64 CI system uses 172.31.0.0/20. Because I was (and am)
lazy, my random_rfc1918_subnet() helper was only checking /24.
This causes flakes.

Solution is to actually do it right: binary arithmetic, prefix
matching. This is effectively impossible in bash, so, use a
hairy perl helper and add copious tests.

Fixes: #18693

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 09:19:32 -06:00
Ed Santiago c841fa9e9a CI: e2e: safer GetPort()
Problem: frequent CI flakes of the form:

   Error: cannot listen on the TCP port: listen tcp4 :5355: bind: address already in use

Always 5355.

Cause: systemd-resolve listens on 5355, but not on 127.0.0.1. So
when GetPort() tries its is-it-in-use check by binding localhost,
it succeeds; but then podman binds * and fails.

Solution: GetPort(): test by binding 0.0.0.0.

Also, improve the failure message.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-26 05:52:02 -06:00
openshift-ci[bot] 0242a7439e
Merge pull request #20470 from edsantiago/curl_port_flake_fix
CI: try to fix more networking flakes
2023-10-25 21:17:03 +00:00
openshift-ci[bot] 5a47b1e150
Merge pull request #20050 from umohnani8/farm-build-2
Add podman farm build command
2023-10-25 19:54:36 +00:00
openshift-ci[bot] 32ef2d7080
Merge pull request #20479 from ygalblum/quadlet-read-only
Quadlet - explicit support for read-only-tmpfs
2023-10-25 19:28:07 +00:00
Ed Santiago c0fb8fe594 CI: try to fix more networking flakes
There's a whole slew of networking-related flakes whose common
element seems to be improper use of curl. Fix those by:

  * add --retry --retry-connrefused; and/or
  * add -S ("show errors". Plain -s silences everything!); and/or
  * test exit status from curl; and/or
  * add wait_for_port after "podman run -d", to avoid races
  * log commands, to make debugging easier

Important note: wait_for_port() was not working with rootless
podman ports. Trivial proof:

  $ podman run -d --name foo -p 8192:80 \
      quay.io/libpod/testimage:20221018 \
      /bin/busybox-extras httpd -f -p 80
  $ grep :2000 /proc/net/tcp
  [no results]

Solution: use ss tool; it seems to handle this just fine.
There may be a better solution.

Oh, also, add -t1 to a podman restart, to shave 18s from test run.

Fixes: #20335 and, I think, a handful of others

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-25 07:24:16 -06:00
openshift-ci[bot] 556898511c
Merge pull request #20481 from vrothberg/fix-20469
compat API: fix image-prune --all
2023-10-25 11:29:30 +00:00
Ygal Blum 76cca08f8a Quadlet - explicit support for read-only-tmpfs
Add Quadlet key and disconnect relationship withr read-only
Update and add tests
Update man with new key

Remove the reference to VolatileTmpfs in the man page to reduce its
usage, since the same functionality can be achieved using the Tmpfs key
while keeping its support to maintain backward compatibility

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-25 13:28:15 +03:00
Valentin Rothberg c13b8e3c9c compat API: fix image-prune --all
Docker deals with the --all flag on the client side while Podman does it
on the server side.  Hence, make sure to not set the dangling filter
with two different values in the backend.

Fixes: #20469
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-25 10:58:00 +02:00
Ygal Blum 0e15861c59 Makefile - allow more control over Ginkgo parameters
Allow the user to control flake retry and color output
Update README

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-25 09:48:36 +03:00
Urvashi Mohnani ebe01ca292 Add e2e tests for farm build
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-24 17:32:47 -04:00
Valentin Rothberg 989afd910e vendor c/{buildah,common}: appendable containers.conf strings, Part 1
This change is the first step of integrating appendable string arrays
into containers.conf and starts with enabling the `Env`, `Mounts`, and
`Volumes` fields in the `[Containers]` table.

Both, Buildah and Podman, read (and sometimes write) the fields of the
`Config` struct at various places, so I decided to migrate the fields
step-by-step.  The ones in this change are most critical ones for
customers.  Once all string slices/arrays are migrated, the docs of
containers.conf will be updated.  The current changes are entirely
transparent to users.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-24 20:33:36 +02:00
openshift-ci[bot] e9e18acd5f
Merge pull request #20451 from rhatdan/volume
Support size option when creating tmpfs volumes
2023-10-24 15:40:50 +00:00
openshift-ci[bot] 83d7c3849f
Merge pull request #20464 from Luap99/libpod-remote
add !remote tag to packages that should not be included in the remote client + vendor c/common
2023-10-24 15:33:03 +00:00
Paul Holzinger 1b466ccbdc
test/e2e: do not import buildah
We only care about the version so just import the define package for it,
the main buildah package causes big transitive imports which fail to
build with the remote tag (i.e. libimage)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-24 13:52:15 +02:00
openshift-ci[bot] ed58ea7849
Merge pull request #20422 from sstosh/api-skip-cgroupv1
test/apiv2: adapt apiv2 test on cgroups v1 environment
2023-10-24 11:23:51 +00:00
Toshiki Sonoda 2e57746ffd test/apiv2: adapt apiv2 test on cgroups v1 environment
Some apiv2 tests are now support on cgroups v1 environment.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-10-24 11:52:03 +09:00
Ed Santiago c3ba0221ec ginkgo setup: retry cache pulls
Because all registries flake.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-23 19:29:18 -06:00
openshift-ci[bot] 83f07729c8
Merge pull request #20454 from containers/renovate/github.com-vbatts-git-validation-1.x
fix(deps): update module github.com/vbatts/git-validation to v1.2.1
2023-10-23 20:42:12 +00:00
openshift-ci[bot] 3abf5c9291
Merge pull request #20452 from edsantiago/cache_k8s_pause
CI: stop using registry.k8s.io
2023-10-23 20:39:08 +00:00
Daniel J Walsh ee60708880
Support size option when creating tmpfs volumes
Fixes: https://github.com/containers/podman/issues/20449

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-23 16:31:54 -04:00
Ed Santiago 85cc4092fc CI: stop using registry.k8s.io
It's flaky.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-23 11:50:41 -06:00
renovate[bot] a8e1a5ed1b
fix(deps): update module github.com/vbatts/git-validation to v1.2.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-23 17:03:31 +00:00
Paul Holzinger 6d99cb5cd6
test fixes for c/common tag chnages
Tag now does a prepend internally instead of append with the names. Thus
the order changed which needs some test changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-23 15:45:46 +02:00
openshift-ci[bot] 19c870da0d
Merge pull request #20425 from giuseppe/podman-do-not-leak-DBUS_SESSION_BUS_ADDRESS-into-conmon
libpod: skip DBUS_SESSION_BUS_ADDRESS in conmon
2023-10-21 18:36:02 +00:00
Paul Holzinger 29273cda10
lint: fix warnings found by perfsprint
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-20 16:27:46 +02:00
Giuseppe Scrivano 03947ab031
libpod: skip DBUS_SESSION_BUS_ADDRESS in conmon
commit 7ade972102 introduced the change
that caused an issue in crun since it forces the root user session
instead of the system one when DBUS_SESSION_BUS_ADDRESS is set.

I am addressing it in crun, but for the time being, let's also not
pass the variable down to conmon since the assumption is that when
running as root the containers must be created on the system bus.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-20 16:06:51 +02:00
openshift-ci[bot] e49ed78a40
Merge pull request #20385 from umohnani8/host-net
Use node hostname in kube play when hostNetwork=true
2023-10-20 12:35:45 +00:00
openshift-ci[bot] 37292a10be
Merge pull request #20405 from giuseppe/do-not-leak-sessions-with-remote
remote: exec: do not leak session IDs on errors
2023-10-19 20:26:49 +00:00
Urvashi Mohnani 936e30f68b Use node hostname in kube play when hostNetwork=true
When the hostNetwork option is set to true in the k8s yaml,
set the pod's hostname to the name of the machine/node as is
done in k8s. Also set the utsns to host.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-19 12:22:58 -04:00
Giuseppe Scrivano 1d2589c3f1
Revert "Emergency workaround for CI breakage"
This reverts commit 44ed415b25.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-19 11:34:36 +02:00
openshift-ci[bot] c2e1debe8d
Merge pull request #20395 from rhatdan/quadlet
Allow systemd specifiers in User and Group Quadlet keys
2023-10-19 09:28:12 +00:00
openshift-ci[bot] 68636416d7
Merge pull request #20357 from rhatdan/TERM
Add TERM iff TERM not defined in container when podman exec -t
2023-10-18 23:50:41 +00:00
Ed Santiago 657029da78 System tests: fix broken silence127
Followup to #20394. For years (since BATS 1.5) we've been
seeing and ignoring nasty red warnings at the end of every
system test run. Thanks for fixing it, @giuseppe! But it
broke down in the '?' case when $expected_rc is empty:

   test/system/helpers.bash: line 345: [: -eq: unary operator expected

Simple fix.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-18 14:33:25 -06:00
Daniel J Walsh b72bb11629
Add TERM iff TERM not defined in container when podman exec -t
Fixes: https://github.com/containers/podman/issues/20334

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-18 15:40:52 -04:00
Ed Santiago 44ed415b25 Emergency workaround for CI breakage
Skip new exec-leak test

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-18 12:07:55 -06:00
openshift-ci[bot] c73e99aabe
Merge pull request #20397 from edsantiago/cp_test_cleanup
systests: cp test: lots of cleanup
2023-10-18 15:07:45 +00:00
openshift-ci[bot] 553cfb6b63
Merge pull request #20368 from ygalblum/quadlet-image-name
Quadlet - support ImageName for .image files
2023-10-18 14:08:56 +00:00
openshift-ci[bot] aabe5c8aa5
Merge pull request #20394 from giuseppe/cleanup-exec-session-on-errors
exec: do not leak session IDs on errors
2023-10-18 13:52:12 +00:00
openshift-ci[bot] 02757ab20d
Merge pull request #20391 from sstosh/nanocpu-api-test
test/apiv2/20-containers.at: fix NanoCPUs tests on cgroups v1
2023-10-18 13:39:18 +00:00
Daniel J Walsh 285718915c
Allow systemd specifiers in User and Group Quadlet keys
Replaces: https://github.com/containers/podman/pull/18262

Signed-off-by: Tom Mombourquette <tom@devnode.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-18 09:23:35 -04:00
Giuseppe Scrivano fa19e1baa2
exec: do not leak session IDs on errors
always cleanup the exec session when the command specified to the
"exec" is not found.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-18 15:02:22 +02:00
Ed Santiago 1efcd1ecfb systests: cp test: lots of cleanup
cp tests flake constantly under VFS (discovered in #20161),
and the way these tests were written makes it very, very hard
to understand failures.

This is a (sorry) hard-to-review cleanup:

 - use distinctive container names, not just "cpcontainer"
 - add distinctive test names (e.g. RUNNING vs CREATED)
 - remove unnecessary code
 - remove --pause=false (option is deprecated and, IIUC, a NOP)
 - clean up some confusing slashes in paths
 - "dot notation" tests:
   - add a comment linking to issue, because that's a weird one
     that makes no sense whatsoever
   - fix tests, because they were actually not testing

This cleanup has been tested repeatedly in 20161, I'm just bringing
it into main because 20161's future is uncertain.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-18 06:47:18 -06:00
Chetan Giradkar 2d65e57ae6 Define better error message for container name conflicts with external storage.
Updated the error message to suggest user to use --replace option to instruct Podman to replace the existsing external container with a newly created one.

closes #16759

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-10-18 12:52:02 +01:00
Ygal Blum 9b8e01efd6 Quadlet - support ImageName for .image files
Allow overriding the image name resolved from the .image file
Add test and doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-18 13:43:54 +03:00
openshift-ci[bot] ef2392f21c
Merge pull request #20381 from vrothberg/fix-20375
image history: fix walking layers
2023-10-18 10:37:48 +00:00
Giuseppe Scrivano 64171043ac
test/system: ignore 127 if it is the expected rc
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-18 12:24:05 +02:00
openshift-ci[bot] a1982c043d
Merge pull request #20365 from p-fruck/fix/api-compat-network-connected
fix(API): Catch ErrNetworkConnected for compat
2023-10-18 08:55:31 +00:00
Toshiki Sonoda c65d1c02b9 test/apiv2/20-containers.at: fix NanoCPUs tests on cgroups v1
* rootful: NanoCpus needs to set more than 10000000 on cgroups v1.
* rootless: Resource limits that include NanoCPUs are not supported and ignored.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-10-18 16:56:18 +09:00
openshift-ci[bot] 6624ccb4b1
Merge pull request #20384 from Luap99/double-netns
libpod: restart+userns cleanup netns correctly
2023-10-18 07:47:02 +00:00
Valentin Rothberg 831844b596 image history: fix walking layers
libimage did not walk thte layers correctly which was probably
inherited by old Podman code.  Fix that by vendoring in the
corresponding changes in c/common.

Fixes: #20375
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-18 09:19:24 +02:00
Philipp Fruck ad53190253
fix(api): Ensure compatibality for network connect
When trying to connect a container to a network and the connection
already exists, an error should only be raised if the container is
already running (or is in the `ContainerStateCreated` transition)
to mimic the behavior of Docker as described here:
https://github.com/containers/podman/pull/15516#issuecomment-1229265942
For running and connected containers 403 is returned which fixes #20365

Signed-off-by: Philipp Fruck <dev@p-fruck.de>
2023-10-17 22:56:32 +02:00
openshift-ci[bot] b0a45a905b
Merge pull request #20366 from ygalblum/quadlet-kube-down-force
Quadlet - add support for KubeDownForce
2023-10-17 19:50:45 +00:00
openshift-ci[bot] 91264e7d2e
Merge pull request #19586 from rhatdan/ps
Fix output of podman --remote top
2023-10-17 19:12:27 +00:00
openshift-ci[bot] c909afb883
Merge pull request #20239 from jackgris/docker-api-error-response
fix: pull error response docker rest api compatibility
2023-10-17 18:51:37 +00:00
Paul Holzinger bbd6281ecc
libpod: restart+userns cleanup netns correctly
When a userns and netns is used we need to let the runtime create the
netns otherwise the netns is not owned by the right userns and thus
the capabilities would not be correct.

The current restart logic tries to reuse the netns which is fine if no
userns is used but when one is used we setup a new netns (which is
correct) but forgot to cleanup the old netns. This resulted in leaked
network namespaces and because no teardown was ever called leaked ipam
assignments, thus a quickly restarting container will run out of ip
space very fast.

Fixes #18615

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-17 17:25:50 +02:00
Ygal Blum 5d5facbd79 Quadlet - add support for KubeDownForce
Allow users to set --force for Stop command
Add doc and tests

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-17 14:43:01 +03:00
openshift-ci[bot] 5853e2bee9
Merge pull request #20363 from ygalblum/quadlet-kube-oneshot-test
System Test - Quadlet kube oneshot
2023-10-17 10:53:40 +00:00
Ygal Blum 6ba67ba96c System Test - Quadlet kube oneshot
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-17 11:15:11 +03:00
openshift-ci[bot] 206177c592
Merge pull request #20376 from edsantiago/buildah_tests
buildah-bud: test relative TMPDIR
2023-10-17 04:50:10 +00:00
Daniel J Walsh 9637fed2fd
Fix output of podman --remote top
Allow users to specify

podman-remote top $cid -eo "pid comm"
or
podman-remote top $cid -eo pid,comm

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

didid#	new file:   test/system/085-top.bats

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-16 17:25:10 -04:00
Ed Santiago dcb421bc5b buildah-bud: test relative TMPDIR
(buildah PR 5084). Should actually have been added as a bud.bats
test in that PR, but I didn't catch it in time.

Also, remove an obsolete bud-tests skip

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-10-16 14:11:35 -06:00
Daniel J Walsh c8604081e8
Fix handling of --read-only-tmpfs flag
Fixes: https://github.com/containers/podman/issues/20225

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-16 14:18:55 -04:00
Aditya R 331e47acb1
test: build with TMPDIR as relative
Test edge-case described here: https://github.com/containers/buildah/pull/5084
Test case in: RHEL-2598

Signed-off-by: Aditya R <arajan@redhat.com>
2023-10-16 14:02:31 +05:30
Gabriel Pozo b9f2c4d171 fix: pull error response docker rest api compatibility
This is related to the issue #20013

Signed-off-by: Gabriel Pozo <jackgris2@gmail.com>
2023-10-13 20:19:18 -03:00
Brent Baude 29f5c563e4 Show client info even if remote connection fails
When people report issues, we often ask for the result of `podman info`.
However, if the problem is the remote connection, it will error out with
no information at all.  This PR at least will report client information
before disclosing the connection error.  For example on Windows:

> .\bin\windows\podman.exe info
client:
  OS: windows/amd64
  provider: hyperv
  version: 4.8.0-dev
  host: null

Satisfies: RUN-1720

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-10-13 08:53:56 -05:00
openshift-ci[bot] e4ef271376
Merge pull request #20347 from Luap99/healthcheck-event
healthcheck: make sure to always show health_status events
2023-10-12 18:15:58 +00:00
Paul Holzinger 99a14332ef
healthcheck: make sure to always show health_status events
This fixes a regression caused by commit 7e6e267329, unfortunately this
was not caught during review as for some reason this works fine rootless
and only fails as root.

Because we set the systemd log level to notice in order to hide the unit
started/stopped messages to prevent spamming the journal the issue is
that this now also causes systemd to ignore the events we write to
journald as we also send them as info level.

To fix this we simply send health_status events now on notice level. I
decided against sending all events on notice as I think info is fine for
them. Whenever the notice level is right is of course debatable but
given it may contain the unhealthy message I think having this a notice
should be ok.

The main reason this made it through testing is because we do not rely
on the systemd unit to fire healthchecks in the tests as this is flaky.
There is one test were we rely on it though and I added a check there
to make sure events are displayed correctly when trigger via systemd.

Fixes #20342

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-12 15:02:32 +02:00
Ygal Blum 702f155288 Quadlet - support oneshot .kube files
Allow users to manually set the Service Type
Add test
Update README

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-11 18:56:29 +03:00
openshift-ci[bot] d437ca8fdc
Merge pull request #20328 from vrothberg/RUN-1936
api: add `compatMode` parameter to libpod's pull endpoint
2023-10-11 13:48:13 +00:00
Valentin Rothberg 8b46e852ef api: add `compatMode` paramenter to libpod's pull endpoint
Add a new `compatMode` parameter to libpod's pull endpoint. If set, the
streamed JSON payload is identical to the one of the Docker compat
endpoint and allows for a smooth integration into existing tooling such
as podman-py and Podman Desktop, some of which already have code for
rendering the compat progress data.

We may add a libpod-specific parameter in the future which will stream
differnt progress data.

Fixes: issues.redhat.com/browse/RUN-1936?
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-11 10:58:05 +02:00
renovate[bot] 40f8976536
fix(deps): update module github.com/cpuguy83/go-md2man/v2 to v2.0.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-10 19:11:10 +00:00
Paul Holzinger 29ae516006
use sqlite as default database
Use sqlite as default but for upgrades it will still use boltdb to avoid
breaking anyone. This is done by checking if the boltdb file already
exists and if it does then we have to use it.

I added a e2e test to check the new logic and removed the system test
for it, the problem with the system test is that we share the storage
dir there so all following commands without --db-backend would try to
use boltdb as a single --db-backend boltdb command will create the file
and then all folllwing commands will use it because of the backwards
compat. In e2e tests each test uses their own --root so it is not an
issue there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-10 17:11:28 +02:00
Urvashi Mohnani d18369ee88 Check for image with /libpod/containers/create
The libpod containers create endpoint wasn't checking whether
the image existed before creating the container. If the image
doesn't exist, it should return a 404 status code but it was
failing and returning a 500 status code.
This fix matches the behavior of the compat endpoint.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-09 13:07:24 -04:00
renovate[bot] 787b1b25c7
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-09 13:26:51 +00:00
openshift-ci[bot] b2c5418fb7
Merge pull request #20288 from albnnc/fix/do-not-ignore-external-containerfiles
fix: don't ignore containerfiles outside of build context
2023-10-09 13:25:29 +00:00
openshift-ci[bot] 6e7e87503c
Merge pull request #20253 from ygalblum/quadlet-command-args
Quadlet - add support for global arguments
2023-10-09 09:01:36 +00:00
Ygal Blum d321d427dc Quadlet - add support for global arguments
Add support for adding podman level arguments before subcommand
Add specific key for Containers Conf Modules
Global arguments are added for both start and stop commands
Adjust testing environment
Add tests
Add to man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-08 10:14:06 +03:00
openshift-ci[bot] e9d6ffa8f0
Merge pull request #20252 from vrothberg/privileged
containers.conf: add `privileged` field to containers table
2023-10-07 11:34:45 +00:00
Aleksei Kosyrev 732cec794e Add system test
Signed-off-by: Aleksei Kosyrev <albnnc@gmail.com>
2023-10-07 10:55:51 +03:00
renovate[bot] 10aa390684
fix(deps): update module golang.org/x/tools to v0.14.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 14:03:02 +00:00
Valentin Rothberg 362eca6691 containers.conf: add `privileged` field to containers table
As requested in containers/podman/issues/20000, add a `privileged` field
to the containers table in containers.conf.  I was hesitant to add such
a field at first (for security reasons) but I understand that such a
field can come in handy when using modules - certain workloads require a
privileged container.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-05 20:14:18 +02:00
openshift-ci[bot] 4a67d22765
Merge pull request #20256 from Luap99/revert-env
Revert --env-file changes
2023-10-05 01:41:59 +00:00
openshift-ci[bot] 3b39d4b082
Merge pull request #20132 from cgiradkar/Issue-17856
Change log level for health_check
2023-10-04 17:59:32 +00:00
Paul Holzinger 1b3cedbf31
test/system: --env-file test fixes
Now that the newline env file change is reverted we have to adapt the
tests.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-04 18:18:18 +02:00
Chetan Giradkar 7e6e267329 Filter health_check and exec events for logging in console
Podman server logs are mostly full of healthcheck output, making them hard to navigate. Hence, made healthcheck service to run with LogLevelMax=notice, this would remove the normal output, inclusive the started/stopped messages from systemd itself.

Fixes #17856

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-10-04 14:50:15 +01:00
Aditya R b576b79329
test, manifest: test push retry
Test: https://github.com/containers/common/pull/1666

Signed-off-by: Aditya R <arajan@redhat.com>
2023-10-03 20:38:02 +05:30
openshift-ci[bot] fe828d2238
Merge pull request #20192 from umohnani8/images
Fix broken podman images filters
2023-10-02 17:49:40 +00:00
OpenShift Merge Robot bbd9590b47
Merge pull request #20194 from umohnani8/kube-mode
Add DefaultMode to kube play
2023-10-02 03:52:34 -04:00
Ygal Blum 979c77f10e Volume create - fast exit when ignore is set and volume exists
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-01 16:54:24 +03:00
Urvashi Mohnani 17cebb3ff8 Add DefaultMode to kube play
Add support for DefaultMode for configMaps and secrets.
This allows users to set the file permissions for files
created with their volume mounts. Adheres to k8s defaults.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-09-29 11:58:38 -04:00
Urvashi Mohnani ba788c1bb8 Fix broken podman images filters
The id, digest, and intermediate filters were broken
for podman images. Fix to match on substrings instead of
the whole string for id and digest. Add the intermediate value
correctly when set.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-09-29 11:39:49 -04:00
OpenShift Merge Robot d602038c2b
Merge pull request #20189 from giuseppe/run--replace-print-only-cid
podman: run --replace prints only the new container id
2023-09-28 21:11:44 -04:00
Giuseppe Scrivano f21c1d238d
podman: run --replace prints only the new container id
print only the new container ID when using --replace instead of the
terminated container ID if it was stopped.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-28 23:32:27 +02:00
Ed Santiago 2b9c0555f4 CI VMs: bump to f39 + f38
...from f38 + f37.

Requires one minor e2e test change, to handle an error logging
change in conmon 2.1.8.

Also, this is important, requires crun-1.9.1 because of a kernel
symlink change; see https://github.com/containers/crun/pull/1309
The VM images here were carefully built to include that. By the
time the next VM images get built, it should be default.

Since we've bumped crun, remove two obsolete skips

And, skip a flaky pasta test, #20170

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-28 11:22:58 -06:00
OpenShift Merge Robot c9730e2329
Merge pull request #20149 from ygalblum/quadlet-container-mount
Quadlet container mount - support non key=val options
2023-09-28 05:38:52 -04:00
OpenShift Merge Robot 46a1e25eb2
Merge pull request #20176 from edsantiago/e2e_check_stderr__more
e2e: ExitCleanly(): the final step
2023-09-28 03:37:26 -04:00
OpenShift Merge Robot 4212b4998d
Merge pull request #19823 from Backfighter/fix-17028
Fix all ports exposed on host by kube play
2023-09-28 03:29:43 -04:00
Ed Santiago ccb7da52c1 e2e: ExitCleanly(): manual special cases
Commit 2 of 2: individual special-case handling of tests
which did not pass under ExitCleanly(), one or more of:

 - add "-q" to commit & push commands
 - add ErrorToString() checks
 - remove unnecessary ErrorToString() checks

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-27 16:04:59 -06:00
Ed Santiago 611db19b31 e2e: ExitCleanly(): the final fron^Wcommit
Final push on RUN-1907. Commit 1 of 2.

This is the final set of test/e2e/*_test.go files to be
converted from Exit(0) to ExitCleanly().

This commit is a mix of automated string-replace with
manual revert-back: tests that did not pass with ExitCleanly()
are reverted back to Exit(0), so they will not show up as
diffs in this commit. When possible, I address those in
my next commit.

My goal was to make this commit a don't-bother-reviewing one
that will also pass tests (so as not to break git-bisect).
The next commit is the important one to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-27 16:04:59 -06:00
Wolfgang Pross bfbd0c8960 move IntelRdtClosID to HostConfig
Signed-off-by: Wolfgang Pross <wolfgang.pross@intel.com>
2023-09-27 16:44:13 +00:00
Wolfgang Pross 24b2f829b9 Add test for Intel RDT support
Signed-off-by: Wolfgang Pross <wolfgang.pross@intel.com>
2023-09-27 16:44:13 +00:00
Ygal Blum f0eb456678 Quadlet container mount - support non key=val options
Some keys, e.g. ro do not have values.
The current implementation crashed looking for the = sign

Externalize findMountType in a new package
Parse mount command using FindMountType
Rebuild parameter string using csv

Add test case and adjust the test framework

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-09-27 16:20:00 +03:00
Paul Holzinger 0b5ea1e6ec
test/e2e: default to netavark
When you run e2e tests locally they use CNI unless the NETWORK_BACKEND
env was set to netavark. Because our main focus is on netavark we should
test it by default.

For local tests this should help to prevent CNI/netavark conflicts as I
assume most systems where people run tests on are on netavark by now.

For  CI testing we hardcode NETWORK_BACKEND there to test both netavark
(on current fedora) and CNI (prior fedora). MAke sure to switch the
logic in the CI setup to reflect that.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-09-27 13:30:20 +02:00
OpenShift Merge Robot 35824b647c
Merge pull request #20148 from vrothberg/conmon-env
libpod: pass entire environment to conmon
2023-09-27 05:10:55 -04:00
Valentin Rothberg 7ade972102 libpod: pass entire environment to conmon
Pass the _entire_ environment to conmon instead of selectively enabling
only specific variables.  The main reasoning is to make sure that conmon
and the podman-cleanup callback process operate in the exact same
environment than the initial podman process.  Some configuration files
may be passed via environment variables.  Podman not passing those down
to conmon has led to subtle and hard to debug issues in the past, so
passing all down will avoid such kinds of issues in the future.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-26 16:48:52 +02:00
Ed Santiago e4b7455b72 e2e: ExitCleanly(): manual fixes to get tests working
Commit 2 of 2: fixes to get tests passing

Mostly reverting back to Exit(0) on tests that produce stderr,
adding stderr checks when those are missing.

One pretty big exception: "run check dns" test was completely
broken in many respects. It should never have worked under CNI,
but was passing because nslookup in that alpine image was
checking /etc/hosts. This has been fixed in subsequent alpine
images, which we're now using in this test (CITEST_IMAGE).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-26 08:47:16 -06:00
Ed Santiago dbd946a932 e2e: ExitCleanly(): a few more
Commit 1 of 2: automated string replace Exit(0) -> ExitCleanly()

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-26 08:47:16 -06:00
OpenShift Merge Robot 97a02a0362
Merge pull request #20130 from edsantiago/fedoraminimal_safe
e2e: use safe fedora-minimal image
2023-09-25 12:47:19 -04:00
OpenShift Merge Robot 2fef4c7ab8
Merge pull request #20088 from vrothberg/fix-19938
fix handling of static/volume dir
2023-09-25 12:29:58 -04:00
Ed Santiago ffd67cf75d e2e: use safe fedora-minimal image
PR #20082 bumped fedora-minimal, from f34 to f39. This worked
fine for a few days, then all of a sudden CI started breaking
because the f39 minimal image got rebuilt and repushed without
adduser. #20127 was an emergency fix; this is a stabler fix.

We keep using not-under-our-control container images, and we
keep getting burned when those get updated in nasty ways. Here
we switch to using a tagged & versioned fedora-minimal image
that is under our control.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-25 09:01:53 -06:00
Valentin Rothberg 59e295f2a3 podman build: correct default pull policy
The default pull policy is "missing" not "always".

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-25 16:28:53 +02:00
Valentin Rothberg 6293ec2e2d fix handling of static/volume dir
The processing and setting of the static and volume directories was
scattered across the code base (including c/common) leading to subtle
errors that surfaced in #19938.

There were multiple issues that I try to summarize below:

 - c/common loaded the graphroot from c/storage to set the defaults for
   static and volume dir.  That ignored Podman's --root flag and
   surfaced in #19938 and other bugs.  c/common does not set the
   defaults anymore which gives Podman the ability to detect when the
   user/admin configured a custom directory (not empty value).

 - When parsing the CLI, Podman (ab)uses containers.conf structures to
   set the defaults but also to override them in case the user specified
   a flag.  The --root flag overrode the static dir which is wrong and
   broke a couple of use cases.  Now there is a dedicated field for in
   the "PodmanConfig" which also includes a containers.conf struct.

 - The defaults for static and volume dir and now being set correctly
   and adhere to --root.

 - The CONTAINERS_CONF_OVERRIDE env variable has not been passed to the
   cleanup process.  I believe that _all_ env variables should be passed
   to conmon to avoid such subtle bugs.

Overall I find that the code and logic is scattered and hard to
understand and follow.  I refrained from larger refactorings as I really
just want to get #19938 fixed and then go back to other priorities.

https://github.com/containers/common/pull/1659 broke three pkg/machine
tests.  Those have been commented out until getting fixed.

Fixes: #19938
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-25 14:14:30 +02:00
OpenShift Merge Robot 919564e1ae
Merge pull request #20127 from vrothberg/fix-20119
unbreak CI: useradd not found
2023-09-25 08:10:24 -04:00
Valentin Rothberg 26b5b1dd3c unbreak CI: useradd not found
The fedora minimal 39 image has been updated on the fedora registry and
removed the `useradd` binary.  Since we were pulling by tag and not by
digest, updates to images outside of our control always entail a certain
risk - and now it bit us.

To fix it, try to move as many users of `useradd` to _our_ CITEST_IMAGE
and migrate the code where necessary to this Alpine-based tooling.
However, the Alpine-based `adduser` binary (not useradd!) doesn't work
well when being executed as a non-root user and will just error out.
Hence, move the fedora minimal image back to version 34 which is still
including the `useradd` binary.

Ultimately, all images on public registries should be pulled via digest
to make sure we pin them down.  I refrain from doing this now to make
sure we can cherry-pick this PR to older branches and get things back
into a working state ASAP.

Fixes: #20119
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-25 11:48:35 +02:00
OpenShift Merge Robot f41d536f19
Merge pull request #20089 from edsantiago/e2e_check_stderr__more
e2e: ExitCleanly(): a few more
2023-09-25 04:12:35 -04:00