Commit Graph

5133 Commits

Author SHA1 Message Date
OpenShift Merge Robot 9ddd4f4abd
Merge pull request #17600 from sstosh/search-auth-opts
Add search --cert-dir, --creds
2023-03-20 04:00:04 -04:00
Ygal Blum 5d1342fc58 Quadlet - Add support for health checks configuration in .container files
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-03-20 09:53:49 +02:00
Daniel J Walsh 46d1650403
Add support for oom_score_adj value from containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-17 12:04:37 -04:00
OpenShift Merge Robot f1bcd0d781
Merge pull request #17757 from rhatdan/ulimits
Use default_ulimits field in containers.conf
2023-03-17 11:43:19 -04:00
Daniel J Walsh 6046832f3e
Use default_ulimits field in containers.conf
The default_ulimits field is currently ignored in podman run commands.
This PR fixes this.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-17 08:04:05 -04:00
Ed Santiago e2d49fb650 CI: test and confirm DESIRED_DATABASE
Just like we do with RUNTIME and NETWORK. Skipped for now in
system tests because there's no way yet to actually set the
database backend.

Also, in system test oneliner (first test), include DB

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-16 15:32:56 -06:00
OpenShift Merge Robot 498194c51f
Merge pull request #17808 from sbrivio-rh/pasta
Revert "Revert "pasta: Use two connections instead of three in TCP ra…
2023-03-16 10:27:15 -04:00
Valentin Rothberg ba141adce4 test/system/255-auto-update.bats: add debug logs
Add debug logs from systemctl and journalctl in hope to get more data on
the Debian flakes tracked in #17796.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-16 11:41:47 +01:00
Stefano Brivio c2a24abc0d Revert "Revert "pasta: Use two connections instead of three in TCP range forward tests""
This reverts commit 1c08f2edac3f9ecf128cf8da91276e963e6ad14c: the
original failure reported in #17287 persists:

  [+1306s] not ok 453 podman networking with pasta(1) - TCP translated port range forwarding, IPv4, loopback

...

  [+1306s] # 2023/03/15 14:33:33 socat[119870] E connect(8, AF=2 127.0.0.1:5127, 16): Interrupted system call
  [+1306s] # xx
  [+1306s] # #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  [+1306s] # #|     FAIL: Mismatch between data sent and received
  [+1306s] # #| expected: = xxx
  [+1306s] # #|   actual:   xx
  [+1306s] # #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

so keep two connections instead of three as long as I'm too dumb to
figure this out.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-16 05:11:30 +01:00
Matt Heon b3035b9d66 Update Cirrus display names, and fix get-ci-vm script
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-15 14:45:28 -04:00
Matt Heon 6142c16a9c Ensure SQLite places uses the runroot in transient mode
Transient mode means the DB should not persist, so instead of
using the GraphRoot we should use the RunRoot instead.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-15 14:45:28 -04:00
Matt Heon 2ec11b16ab Fix various integration test issues with SQLite state
Two main changes:
- The transient state tests relied on BoltDB paths, change to
  make them agnostic
- The volume code in SQLite wasn't retrieving and setting the
  volume plugin for volumes that used one.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-15 14:45:18 -04:00
Matt Heon 0f8530b1ee Remove test for pod/container name global uniqueness
We're removing this constraint from the database, so we should
not be verifying it in CI anymore.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-15 14:44:47 -04:00
Matt Heon 39fd9aa084 Add SQLite job to CI
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-15 14:44:47 -04:00
OpenShift Merge Robot 990f4328b6
Merge pull request #17797 from containers/dependabot/go_modules/test/tools/github.com/vbatts/git-validation-1.2.0
build(deps): bump github.com/vbatts/git-validation from 1.1.0 to 1.2.0 in /test/tools
2023-03-15 12:13:44 -04:00
OpenShift Merge Robot 2718f54a29
Merge pull request #17729 from rhatdan/selinux
Support running nested SELinux container separation
2023-03-15 12:07:03 -04:00
dependabot[bot] 2b4a27719c
build(deps): bump github.com/vbatts/git-validation in /test/tools
Bumps [github.com/vbatts/git-validation](https://github.com/vbatts/git-validation) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/vbatts/git-validation/releases)
- [Commits](https://github.com/vbatts/git-validation/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/vbatts/git-validation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 13:00:58 +00:00
Valentin Rothberg 408e764b94 events: no duplicates when streaming during a log rotation
When streaming events, prevent returning duplicates after a log rotation
by marking a beginning and an end for rotated events.  Before starting to
stream, get a timestamp while holding the event lock.  The timestamp
allows for detecting whether a rotation event happened while reading the
log file and to skip all events between the begin and end rotation
event.

In an ideal scenario, we could detect rotated events by enforcing a
chronological order when reading and skip those detected to not be more
recent than the last read event.  However, events are not always
_written_ in chronological order.  While this can be changed, existing
event files could not be read correctly anymore.

Fixes: #17665
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-15 10:28:16 +01:00
Toshiki Sonoda 82f2f8258c Add search --cert-dir, --creds
When we searching any image at a container registry,
--cert-dir and --creds could be required
as well as push, pull, etc.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-03-15 15:01:26 +09:00
OpenShift Merge Robot f8f5f3cec6
Merge pull request #17781 from Luap99/trace-hijack
system service --log-level=trace: support hijack
2023-03-14 17:48:49 -04:00
OpenShift Merge Robot 998acd760f
Merge pull request #17707 from Luap99/wait-for-port
test/system: fix wait_for_port() to wait for bind
2023-03-14 12:35:58 -04:00
OpenShift Merge Robot 08cd180abc
Merge pull request #17736 from giuseppe/no-private-cgroupns-systemd
cgroupns: private cgroupns on cgroupv1 breaks --systemd
2023-03-14 11:33:24 -04:00
OpenShift Merge Robot 1a8a5bc04c
Merge pull request #17758 from edsantiago/bud_rootless_remote
bud tests: rootless remote: use correct socket path
2023-03-14 10:26:57 -04:00
OpenShift Merge Robot 6025103196
Merge pull request #17759 from sbrivio-rh/pasta
Revert "pasta: Use two connections instead of three in TCP range forward tests"
2023-03-14 10:00:02 -04:00
Paul Holzinger 7d8d3e810f
system service --log-level=trace: support hijack
When the service is running with trace log level it wraps the
`http.ResponseWriter` to log extra information. The problem is that the
new type does not keep all the functions from the embedded type.
Instead we have to implement them ourselves, however only Write() was
implemented. Thus `Hijack()`could not be called on the writer. To
prevent these issues we would implement all the interfaces that the
inner type supports (Header, WriteHeader, Flush, Hijack).

Fixes #17749

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-14 14:33:52 +01:00
Paul Holzinger eed389508e
test/system: fix wait_for_port() to wait for bind
The goal of the wait_for_port() function is to return when the port is
bound. This is to make sure we wait for application startup time.
This can be seen in some comments of the callers.

Commit 7e3d04fb caused this regression while reworking the logic to read
ports from /proc. I doesn't seem to cause problems in CI, properly
because the function returns before the port is bound.
I have not seen any flakes related to this but I only see the ones on
PRs where I rerun tests so it is best to wait for Ed to take a look.

Also fixes the broken ipv4_to_procfs() which only passes one argument to
__ipv4_to_procfs(), this results in the ipv4 not beeing inverted.
Therefore all bind checks against a direct ipv4 did not work.
This function accepts only an ipv4 but one caller passes localhost
which is invalid.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-14 14:24:04 +01:00
Giuseppe Scrivano 2d1f4a8bff
cgroupns: private cgroupns on cgroupv1 breaks --systemd
On cgroup v1 we need to mount only the systemd named hierarchy as
writeable, so we configure the OCI runtime to mount /sys/fs/cgroup as
read-only and on top of that bind mount /sys/fs/cgroup/systemd.

But when we use a private cgroupns, we cannot do that since we don't
know the final cgroup path.

Also, do not override the mount if there is already one for
/sys/fs/cgroup/systemd.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-14 12:34:52 +01:00
Valentin Rothberg 7a7af735ad test/system/255-auto-update.bats: multiple services
Wait for all generated services to be ready to be sure we can iron out
race conditions.  Also disable rollbacks to make sure we can analyze
the error if restarting a service fails.  This information may be
crucial to understand the flakes on Debian as tracked in #17607.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-14 10:30:32 +01:00
Valentin Rothberg 40d0d233eb 255-auto-update.bats: turn off rollback where needed
To help debug #17607, turn off rollbacks for tests that do not require
rollbacks.  Error when restarting the systemd units are then not
suppressed but returned which should give us more information about what
is going on the Debian systems.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-14 10:16:59 +01:00
Stefano Brivio 1c08f2edac Revert "pasta: Use two connections instead of three in TCP range forward tests"
This reverts commit e33f4e0bc7, going
back to three connections (not two) for each range in TCP tests. I'm
not sure yet what caused the original issue, but it might be fixed
now. If it does, this fixes #17287.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-13 20:40:15 +01:00
Daniel J Walsh ad8a96ab95
Support running nested SELinux container separation
Currently Podman prevents SELinux container separation,
when running within a container. This PR adds a new
--security-opt label=nested

When setting this option, Podman unmasks and mountsi
/sys/fs/selinux into the containers making /sys/fs/selinux
fully exposed. Secondly Podman sets the attribute
run.oci.mount_context_type=rootcontext

This attribute tells crun to mount volumes with rootcontext=MOUNTLABEL
as opposed to context=MOUNTLABEL.

With these two settings Podman inside the container is allowed to set
its own SELinux labels on tmpfs file systems mounted into its parents
container, while still being confined by SELinux. Thus you can have
nested SELinux labeling inside of a container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-13 14:21:12 -04:00
Ed Santiago 159936a114 bud tests: rootless remote: use correct socket path
Another followup to #17608. Nightly tests were hanging,
because /run/podman/podman.sock was hardcoded (bad idea
for rootless). Poor testing on my part.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-13 10:59:38 -06:00
Giuseppe Scrivano fb4f6f95c5
test: reenable idmap test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-11 12:15:38 +01:00
OpenShift Merge Robot 9a45503c80
Merge pull request #17249 from rhatdan/qm
Must use mountlabel when creating builtin volumes
2023-03-09 14:27:05 -05:00
Daniel J Walsh b5a99e0816
Must use mountlabel when creating builtin volumes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-09 12:36:52 -05:00
Daniel J Walsh 21651706e3
podman inspect list network when using --net=host or none
This will match Docker behaviour.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-08 17:27:08 -05:00
OpenShift Merge Robot 747369c82d
Merge pull request #17713 from sbrivio-rh/pasta
pasta: Re-enable "Local forwarder, IPv4" test now that packages in CI images are fixed
2023-03-08 20:22:45 +01:00
Stefano Brivio f928cf54aa pasta: Re-enable "Local forwarder, IPv4" test, accept NXDOMAIN as response
This case is fixed by passt commit bad252687271 ("conf, udp: Allow
any loopback address to be used as resolver") and the fix is now
available in packages included by the CI images.

Note that, depending on the resolver on the host, we might get
1.0.0.127.in-addr.arpa resolved to localhost, or simply NXDOMAIN for
it: accept a failure on the nslookup command, as long as we have a
response for 1.0.0.127.in-addr.arpa in the output. If we have any
response, that means we could talk to the resolver.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-03-08 17:09:40 +01:00
dependabot[bot] 829e910cde
build(deps): bump golang.org/x/tools from 0.6.0 to 0.7.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 13:02:30 +00:00
restitux cb3cda55f2 Quadlet: add support for setting --ip and --ip6
Signed-off-by: restitux <restitux@ohea.xyz>
2023-03-06 18:36:41 -07:00
Valentin Rothberg e77f370f86 sqlite: add a hidden --db-backend flag
Add a hidden flag to set the database backend and plumb it into
podman-info.  Further add a system test to make sure the flag and the
info output are working properly.

Note that the test may need to be changed once we settled on how
to test the sqlite backend in CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-02 13:43:11 +01:00
OpenShift Merge Robot 8457bb5542
Merge pull request #16717 from umohnani8/detach
play kube: Add --wait option
2023-03-01 16:46:54 +01:00
OpenShift Merge Robot 4f4665cbda
Merge pull request #17673 from vrothberg/fix-17607
auto-update test: wait for service to be ready
2023-03-01 16:09:14 +01:00
OpenShift Merge Robot 86a0e44ccd
Merge pull request #17659 from cevich/fix_bud_git_config
Cirrus: Fix git config permission denied
2023-03-01 15:15:35 +01:00
OpenShift Merge Robot 69ba3548f0
Merge pull request #17653 from Luap99/fix-17616
fix "podman logs --since --follow" flake
2023-03-01 15:12:32 +01:00
Valentin Rothberg 51cf2dd363 test/system/255-auto-update.bats: wait 10 for update to finish
10 seconds is used by most other tests as a timeout. Given the test
flakes on Debian use it.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-01 14:45:59 +01:00
Valentin Rothberg b727f30ac6 auto-update test: wait for service to be ready
The symptoms in #17607 point to some race since it does not always flake
on Debian (and Debian only).  Hence, wait for the service to be ready
before building the image to make sure that the service is started with
the old image and that everything's in order.

Fixes: #17607
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-01 13:43:29 +01:00
OpenShift Merge Robot 3cab05aa3e
Merge pull request #17656 from ygalblum/quadlet-container-mount
Quadlet: Add support for the Mount key in .container files
2023-03-01 09:21:09 +01:00
OpenShift Merge Robot 02a77d27a2
Merge pull request #17450 from danishprakash/add-group-entry
create: add entry to /etc/group via `--group-entry`
2023-02-28 21:59:59 +01:00
Urvashi Mohnani 20a42d0e4f play kube: Add --wait option
Add a way to keep play kube running in the foreground and terminating all pods
after receiving a a SIGINT or SIGTERM signal. The pods will also be
cleaned up after the containers in it have exited.
If an error occurrs during kube play, any resources created till the
error point will be cleane up also.

Add tests for the various scenarios.

Fixes #14522

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-28 13:45:36 -05:00
Chris Evich 6babef5983
Cirrus: Fix git config permission denied
The buildah bud tests run rootless, so attempting to bypass the
ident-check with a `git config --system` fails with a permission denied
error (as it should).  Update the command to use `--global` instead,
which writes to `~/.gitconfig` and so works for regular users.

Also setup a fake identity for the CI-user and enable shell-debugging
for the commands to inform humans of what is happening in the script.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-28 10:52:20 -05:00
Ygal Blum ccc5aa59a0 Quadlet: Add support for the Mount key in .container files
Handle the Mount key
Reuse code from the handling of the Volume key
Add E2E Test
E2E Test - Add checker for KeyValue string
Update man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-02-28 16:14:19 +02:00
OpenShift Merge Robot a5895e3ed7
Merge pull request #17650 from sbrivio-rh/pasta
Revert "Skip all pasta tests"
2023-02-28 13:47:27 +01:00
Paul Holzinger 77861d6af3
fix "podman logs --since --follow" flake
The test should make sure the logs --follow call will log entries that
are created in the future when --since is used and doe not include the
container start event. However it seems the timing is to tight. I think
it was possible that CI logged the line before the logs call was made,
thus it is missing because --since excluded it.

I cannot reproduce so I am not 100% on this but we can reopen the issue
if it still happens.

Fixes #17616

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-28 13:31:28 +01:00
Stefano Brivio 42540a6679 Revert "Skip all pasta tests"
This reverts commit 81f116c59c291793742e10ea84b77511902a0338: the
passt package for Fedora 37 images is now fixed in the
c20230223t153813z-f37f36d12 image.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-28 11:37:59 +01:00
Chris Evich 0f92e19e8e
Cirrus: Fix bud tests failing to apply patches
For some weeks or longer, the buildah bud tests have been failing under
cirrus-cron with the message:

```
+ git am --reject
Committer identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for
<some30462dude@cirrus-task-5479994827210752.c.libpod-218412.internal>)
not allowed
```

Fix this by marking the clone directory "safe" when the script is
running under CI.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-27 12:08:41 -05:00
Ed Santiago d838c08b30 buildah-bud tests: don't sudo when rootless is desired
Followup to #17608, rootless buildah-bud in cron. I forgot
one crucial step, skipping the sudo.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-24 05:49:45 -07:00
OpenShift Merge Robot afa0167d47
Merge pull request #17601 from ygalblum/quadlet-do-not-set-runtime
Quadlet - use the default runtime
2023-02-23 10:54:48 +01:00
OpenShift Merge Robot 3796e22761
Merge pull request #17586 from mheon/add_sql_state
Add initial SQLite-backed state implementation
2023-02-23 09:11:05 +01:00
Ygal Blum 0d75854c52 Quadlet - use the default runtime
Do not set the runtime when processing a .container file
Let Podman choose the runtime based on its configuration

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-02-23 09:29:39 +02:00
OpenShift Merge Robot 7fba1db31a
Merge pull request #17526 from danishprakash/fix-kube-secret
kube: rm secret on down, print secret on play
2023-02-22 19:34:18 +01:00
OpenShift Merge Robot efbc35601f
Merge pull request #17305 from cevich/swap_ubuntu_debian
Replace Ubuntu -> Debian SID
2023-02-22 19:31:45 +01:00
Matt Heon 89d0ccd195 Get E2E tests to pass
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-02-22 11:00:50 -05:00
Chris Evich 81f116c59c
Skip all pasta tests
A horrible timeout-flake exists in the version presently in CI VM images
`c20230221t162829z-f37f36d12`.  Since the PR for adding the 2023-02-21
images is more urgently needed (#17305) than a pasta fix, skip all pasta
tests while waiting for a fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:55:12 -05:00
Chris Evich 642e9ddb8d
Skip buildah-bud test
Test is completely broken, see buildah issue 4396.

Thanks to @edsantiago for the patch.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:44:03 -05:00
Chris Evich 10382d0bca
Skip buildx test with VFS podman storage driver
Ref: https://github.com/containers/podman/issues/17520

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:44:03 -05:00
Chris Evich dd51b62b7a
Skip 'podman kube --network' test for rootless CGv1
Test emits nasty warning message:
`Resource limits are not supported and ignored on cgroups V1 rootless
systems`

Ref: issue #17582

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:43:19 -05:00
Chris Evich 197529f084
Skip tests which fail with CGv1 & runc
* Skip play-kube test when runc is in use #17436
* Skip uid/gidmapping idmapped-volume test #17433

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:35:03 -05:00
OpenShift Merge Robot d71c341b94
Merge pull request #17603 from edsantiago/bats_cleanup
Logs follow-until tests: loosen checks
2023-02-22 16:32:01 +01:00
Chris Evich 5b4f248a84
Skip rootless CGv1 quadlet tests due to issue
Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-22 10:31:18 -05:00
OpenShift Merge Robot d5a82485a1
Merge pull request #17577 from giuseppe/idmapping-mounts-always-direct-mapping
libpod: always use direct mapping for idmapped mounts
2023-02-22 14:53:33 +01:00
Ed Santiago 12153da837 Logs follow-until tests: loosen checks
...in hopes of fixing a flake with podman-remote. It's still
possible that there's a real problem with logs under remote,
and this will just sweep that under the rug.

Also, fix a nasty-red test warning (add cleanup), refactor
uses of $(pause_image), and improve a few test assertions.

Closes: #17286

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-22 06:24:51 -07:00
OpenShift Merge Robot 38c91945a6
Merge pull request #17578 from Luap99/netavark-dns
netavark: only use aardvark ip as nameserver
2023-02-22 14:04:12 +01:00
OpenShift Merge Robot 44bd6dd1fc
Merge pull request #17594 from Luap99/compat-network-create
compat API: network create return 409 for duplicate
2023-02-21 22:47:30 +01:00
Paul Holzinger 4b4b423b6c
compat API: network create return 409 for duplicate
If the name already exists and CheckDuplicate is set we need to return
409, if CheckDuplicate is not set we return the network without error.

Fixes #17585

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-21 16:55:27 +01:00
OpenShift Merge Robot 36db47df98
Merge pull request #17588 from ygalblum/quadlet-logdriver
Quadlet: Add support for LogDriver key in container and kube units
2023-02-21 16:24:03 +01:00
Valentin Rothberg adacd3b127 vendor c/common@852ca05a1f
Also force an update of c/image to prevent a downgrade.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-21 14:06:42 +01:00
Ygal Blum 6a3757b73a Quadlet: Add support for LogDriver key in container and kube units
Allow the user to set the log driver while keeping the default of passthrough

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-02-21 11:56:35 +02:00
Giuseppe Scrivano af8d649da7
libpod: always use direct mapping
always use the direct mapping when writing the mappings for an
idmapped mount.  crun was previously using the reverse mapping, which
is not correct and it is being addressed here:

https://github.com/containers/crun/pull/1147

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-20 18:34:11 +01:00
OpenShift Merge Robot d10af21e14
Merge pull request #17502 from Luap99/passthrough-logs
podman logs: read journald with passthrough
2023-02-20 16:37:04 +01:00
Paul Holzinger 9dc730d9f3
netavark: only use aardvark ip as nameserver
Since commit 06241077cc we use the aardvark per container dns
functionality. This means we should only have the aardvark ip in
resolv.conf otherwise the client resolver could skip aardvark, thus
ignoring the special dns option for this container.

Fixes #17499

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-20 15:56:17 +01:00
dependabot[bot] e9942c61dd build(deps): bump github.com/container-orchestrated-devices/container-device-interface
Bumps [github.com/container-orchestrated-devices/container-device-interface](https://github.com/container-orchestrated-devices/container-device-interface) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/container-orchestrated-devices/container-device-interface/releases)
- [Commits](https://github.com/container-orchestrated-devices/container-device-interface/compare/v0.5.3...v0.5.4)

---
updated-dependencies:
- dependency-name: github.com/container-orchestrated-devices/container-device-interface
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

[NO NEW TESTS NEEDED]

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-20 14:51:04 +01:00
Paul Holzinger 79a05ca2b4
podman logs passthrough driver support --cgroups=split
When run with --cgroups=split mode (e.g. quadlet) we do not use the a
separate cgroup for the container and just run in the unit cgroup.
When we filter logs we thus must match the unit name.
Added a small test to the quadlet test to make sure it will work.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-20 13:58:16 +01:00
Paul Holzinger d7e96536ee
journald logs: simplify entry parsing
It makes little sense to create a log line string from the entry just to
parse it again into a LogLine. We have the typed fields so we can
assemble the logLine direclty, this makes things simpler and more
efficient.

Also entries from the passthrough driver do not use the CONTAINER_ID_FULL
field, instead we can just access c.ID() directly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-20 13:58:15 +01:00
Paul Holzinger 1590c7bf42
podman logs: read journald with passthrough
The passthrough driver is designed for use in systemd units. By default
we can expect systemd to log the output on journald unless the unit sets
differen StandardOutput/StandardError settings.

At the moment podman logs just errors out when the passthrough driver is
used. With this change we will read the journald for the unit messages.
The logic is actually very similar to the existing one, we just need to
change the filter. We now filter by SYSTEMD_UNIT wich equals to the
contianer cgroup, this allows us the actually filter on a per contianer
basis even when multiple contianers are started in the same unit, i.e.
via podman-kube@.service.

The only difference a user will see is that journald will merge
stdout/err into one stream so we loose the separation there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-20 13:58:12 +01:00
OpenShift Merge Robot 8d9517c38f
Merge pull request #17508 from vrothberg/fix-17181
auto-update: support pods
2023-02-20 12:51:43 +01:00
danishprakash 2659a3228a
kube: rm secret on down, print secret on play
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-20 16:24:40 +05:30
OpenShift Merge Robot f9b066ff38
Merge pull request #17548 from vrothberg/fix-17482
kube play: only enforce passthrough in Quadlet
2023-02-17 16:00:55 +01:00
OpenShift Merge Robot b55df7f151
Merge pull request #17538 from edsantiago/system_test_assert
System tests: assert(): friendlier failure messages
2023-02-17 12:04:56 +01:00
Valentin Rothberg c95978f600 kube play: only enforce passthrough in Quadlet
Only enforce the passthrough log driver for Quadlet. Commit 68fbebf
introduced a regression on the `podman-kube@` template as `podman logs`
stopped working and settings from containers.conf were ignored.

Fixes: #17482
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-17 11:57:10 +01:00
OpenShift Merge Robot f9af49622d
Merge pull request #17464 from hasan4791/issue-16711
[FEAT] Support sysctl configurations from Pod Spec
2023-02-17 11:41:49 +01:00
Valentin Rothberg 6dd7978442 auto-update: support pods
Support auto updating containers running inside pods.  Similar to
containers, the systemd units need to be generated via
`podman-generate-systemd --new $POD` to generate the pod's units.

Note that auto updating a container inside a pod will restart the entire
pod.  Updates of multiple containers inside a pod are batched, such that
a pod is restarted at most once.  That is effectively the same mechanism
for auto updating containers in a K8s YAML via the `podman-kube@`
template or via Quadlet.

Updating a single container unit without restarting the entire pod is
not possible.  The reasoning behind is that pods are created with
--exit-policy=stop which will render the pod to be stopped when auto
updating the only container inside the pod.  The (reverse) dependencies
between the pod and its containers unit have been carefully selected for
robustness.  Changes may entail undesired side effects or backward
incompatibilities that I am not comfortable with.

Fixes: #17181
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-17 10:31:28 +01:00
Ed Santiago c81fbd5d0a System tests: assert(): friendlier failure messages
...safer, too: the big change is using 'mapfile' to split
multiline strings; this preserves empty lines, making it
easy to see spurious (or missing) blank lines in output.

Another change is to indent the expected-output string
consistently, for readability.

Then, to handle \r (CR) and other control characters, use
bash %q to format special chars. But %q makes\ it\ hard\ to
read\ lines\ with\ spaces, so strip off those backslashes.
This makes assert() much larger and uglier, but this is
code that shouldn't be touched often.

Finally, because these are big changes to critical code,
write a complicated regression test suite for assert().

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-16 17:47:10 -07:00
T K Chandra Hasan 94d4b5278f Support sysctl configs via podman kube play
Support sysctl configuration from Pod spec via podman kube play CLI

Closes #16711

Signed-off-by: T K Chandra Hasan <t.k.chandra.hasan@ibm.com>
2023-02-16 19:06:38 +05:30
Ed Santiago a4677405c8 quadlet system tests: add useful defaults, logging
Tests constantly fail with zero indication of why. Fix that.
 - add correct default for $QUADLET path
 - add check to make sure it exists
 - log quadlet commands and their output

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-16 05:41:53 -07:00
Ed Santiago 86e55d0ec1 system tests: prevent leading tabs
Replace existing tab indentations with spaces, and add
a test to CI to prevent new ones from sneaking in.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-15 13:50:17 -07:00
OpenShift Merge Robot d63d91694e
Merge pull request #17493 from rhatdan/quadlet
Quadlet use crun specified in containers.conf
2023-02-15 09:26:27 -05:00
OpenShift Merge Robot 0cad682d88
Merge pull request #17392 from sstosh/e2e-kube-unshare
e2e: adapt play kube test on remote rootless
2023-02-15 09:15:33 -05:00
OpenShift Merge Robot 83757ccb55
Merge pull request #17506 from rhatdan/build
Allow specification of podman --remote build -f -
2023-02-15 09:13:05 -05:00
OpenShift Merge Robot eb75246f31
Merge pull request #17207 from danishprakash/add-systemd-shm-size
add support for limiting tmpfs size for systemd-specific mnts
2023-02-15 05:53:40 -05:00
OpenShift Merge Robot cfa38114ad
Merge pull request #17483 from vyasgun/pr/filter-fix
fix != filter in volume prune
2023-02-15 05:22:41 -05:00
danishprakash 828708bac2
create: add support for --group-entry
* add test
* update documentation

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-15 11:20:18 +05:30
vyasgun 33a918711f fix != filter in volume prune
Signed-off-by: vyasgun <vyasgun20@gmail.com>
2023-02-15 10:55:21 +05:30
Daniel J Walsh 4c5b79120c
Allow specification of podman --remote build -f -
Fixes: https://github.com/containers/podman/issues/17495

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-15 05:44:15 +02:00
Daniel J Walsh 3d8936642e
Quadlet use crun specified in containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-15 05:39:56 +02:00
Urvashi Mohnani c0f983db87 Don't set hostPort when generating a service
When generating a kube yaml with kube generate, do not
set the hostPort in the pod spec if the service flag is
set and we are generating a service kind too.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-14 11:00:28 -05:00
danishprakash 0999991b20
add support for limiting tmpfs size for systemd-specific mnts
* add tests
* add documentation for --shm-size-systemd
* add support for both pod and standalone run

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-14 14:56:09 +05:30
OpenShift Merge Robot 1e06c1a47a
Merge pull request #17379 from umohnani8/ulimit
Add ulimit annotation to kube gen & play
2023-02-13 21:59:49 -05:00
OpenShift Merge Robot 26ed4f3447
Merge pull request #17488 from containers/dependabot/go_modules/test/tools/golang.org/x/tools-0.6.0
build(deps): bump golang.org/x/tools from 0.5.0 to 0.6.0 in /test/tools
2023-02-13 16:21:45 -05:00
OpenShift Merge Robot 4debbd108b
Merge pull request #17487 from vrothberg/quadlet-stop
quadlet: add ExecStop
2023-02-13 13:45:40 -05:00
OpenShift Merge Robot aab06f5724
Merge pull request #17489 from vrothberg/fix-16091
install sigproxy before start/attach
2023-02-13 13:06:50 -05:00
Urvashi Mohnani 35d16ea027 Add ulimit annotation to kube gen & play
Add a podman ulimit annotation to kube generate and play.
If a container has a container with ulimits set, kube gen
will add those as an annotation to the generated yaml.
If kube play encounters the ulimit annotation, it will set
ulimits for the container being played.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-13 11:38:24 -05:00
Valentin Rothberg 7c54d14232 quadlet: add ExecStop
Remove the container in ExecStop to make sure that Quadlet's adheres to
Podman's customizable stop signal/timeout.  Certain programs ignore
SIGTERM which renders the services generated by Quadlet less user
friendly compared to the ones from podman-generate-systemd.

Previously, `systemctl stop` would just hang until systemd's stop
timeout is hit.  Since `podman rm` also removes the CID file, the
additional `rm` can be removed.  Note that `podman rm` will return
immediately if the specified CID file isn't present.

I am working on a short tutorial on Quadlet and hit the issue with a
simple container running `sleep`.  `sleep` ignores SIGTERM and stopping
the service would take forever even with `PodmanArgs=--stop-timeout=0`.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-13 15:21:48 +01:00
Valentin Rothberg d2ac85f7aa install sigproxy before start/attach
Install the signal proxy before attaching to/starting the container to
make sure there's no race-condition as revealed in the failing start/run
tests in #16901.  The tests had the valid expectation that signal
forwarding works once the container is running.

Further update the tests to account for the attach test where the
expectation is that signal forwarding works once Podman has attached to
container (or even before).

Fixes: #16901
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-13 15:13:42 +01:00
dependabot[bot] 191e4ce40c
build(deps): bump golang.org/x/tools from 0.5.0 to 0.6.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 13:07:08 +00:00
Erik Sjölund a5ca732256 Fix typos
Software version used
https://github.com/crate-ci/typos/releases/tag/v1.13.10

The binary was downloaded from
https://github.com/crate-ci/typos/releases/download/v1.13.10/typos-v1.13.10-x86_64-unknown-linux-musl.tar.gz

Command that was run:

typos --write-changes docs cmd cni contrib dependencies docs hack libpod pkg utils

False positives were manually removed.
A few marshaling/existant typos were manually fixed.

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-02-11 18:23:24 +01:00
Valentin Rothberg 1541ce56cf kube play: set service container as main PID when possible
Commit 4fa307f149 fixed a number of issues in the sdnotify proxies.
Whenever a container runs with a custom sdnotify policy, the proxies
need to keep running which in turn required Podman to run and wait for
the service container to stop.  Improve on that behavior and set the
service container as the main PID (instead of Podman) when no container
needs sdnotify.

Fixes: #17345
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-10 13:31:03 +01:00
Erik Sjölund 08e13867a9 Fix typos. Improve language.
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-02-09 21:56:27 +01:00
OpenShift Merge Robot d5e1e278a3
Merge pull request #17221 from mtrmac/eof-range-requests
Vendor c/image after https://github.com/containers/image/pull/1816
2023-02-09 14:02:28 -05:00
OpenShift Merge Robot 9eaf965a21
Merge pull request #17449 from rhatdan/codespell
Run codespell on codebase
2023-02-09 13:59:35 -05:00
OpenShift Merge Robot d8de65bb8b
Merge pull request #17412 from umohnani8/alias
Add ctrName to network alias during kube play
2023-02-09 13:56:19 -05:00
Ed Santiago 9cba0474b5 events + container inspect test: RHEL fixes
Primarily, add skip_if_journald_unavailable because RHEL.

Secondarily, reverse a flipped actual/expect assertion
that made it difficult to understand the RHEL failure.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-09 06:49:32 -07:00
Urvashi Mohnani 5a9074dabb Add ctrName to network alias during kube play
We currently name the container being created during kube play
as ctrName-podName, but this is not how it is done in k8s.
Since we can't change this at the CLI level as it will be a breaking
change (it will be planned for podman 5.0), add only ctrName as an alias
to the network of the pod.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-09 08:25:13 -05:00
Daniel J Walsh 5865159766
Run codespell on codebase
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-09 08:02:43 -05:00
Miloslav Trmač e308ba0215 Vendor c/image after https://github.com/containers/image/pull/1816
Also includes unreleased https://github.com/openshift/imagebuilder/pull/246 to work
with the updated docker/docker dependency.

And updates some references to newly deprecated docker/docker symbols.

[NO NEW TESTS NEEDED]

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-02-08 22:37:38 +01:00
OpenShift Merge Robot 34e76a46ab
Merge pull request #17423 from ygalblum/quadlet_container_secret
Quadlet: Add support for the Secret key in Container group
2023-02-08 15:45:41 -05:00
OpenShift Merge Robot bd40dbc553
Merge pull request #17420 from vrothberg/fix-kube-start
kube play: do not teardown unconditionally on error
2023-02-08 09:29:26 -05:00
OpenShift Merge Robot 82af4dd531
Merge pull request #17380 from sbrivio-rh/pasta
tests: pasta: Mitigation for socat connect() getting EINTR and two other fixes
2023-02-08 09:24:17 -05:00
Ygal Blum d6dd17fdfe Quadlet: Add support for the Secret key in Container group
Add E2E tests
Add system test
Add to man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-02-08 16:12:08 +02:00
OpenShift Merge Robot b829588a32
Merge pull request #17421 from sstosh/e2e-fix-remote
e2e: fix some tests on remote
2023-02-08 07:29:47 -05:00
Toshiki Sonoda 43b3570680 e2e: fix some tests on remote
- podman-remote unshare returns an error message
  with the exit code '125'.

- Need to run RestartRemoteService() to apply
  changes to the TMPDIR.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-02-08 18:07:41 +09:00
Valentin Rothberg 83367a6b3b kube play: do not teardown unconditionally on error
Commit 2f29639bd3 added a UX improvement to cleanup/teardown when
running the specified YAML has failed.  However, the teardown happens
unconditionally such that rerunning the same YAML file will teardown the
previously created workload instead of just failing with a name-conflict
error (e.g., "pod already exists").  The regression popped up testing
the Ansible system role with Podman v4.4.0.

For now, do not teardown at all on error to quickly fix this regression
for the upcoming Podman v4.4.1 release.  The UX improvement is still
desired but must be conditional and only happen on newly created
resources, which probably requires moving it down to the backend.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-08 09:20:16 +01:00
Alex Jia ac71fa01c3 Fix typos in comments
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2023-02-08 10:05:27 +08:00
OpenShift Merge Robot 6ce76720be
Merge pull request #17402 from Luap99/update-lint
update golangci-lint to version 1.51.1
2023-02-07 11:00:16 -05:00
Paul Holzinger 77e4b19397
update golangci-lint to version 1.51.1
The new version contains the ginkgolinter, which makes sure the
assertions are more helpful.

Also replace the deprecated os.SEEK_END with io.SeekEnd.

There is also a new `musttag` linter which checks if struct that are
un/marshalled all have json tags. This results in many warnings so I
disabled the check for now. We can reenable it if we think it is worth
it but for now it way to much work to fix all report problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-07 14:16:21 +01:00
Valentin Rothberg f1352521ff Quadlet: exit 0 when there are no files to process
Quadlet should not exit with failure if no files to process have been
found.  Otherwise, even simple operations such as reloading systemd
will fail as it retriggers generators.

Fixes: #17374
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 10:48:31 +01:00
Toshiki Sonoda 315215020d e2e: adapt play kube test on remote rootless
Use podmanTest.PodmanBinary because podman-remote unshare
cannot be used.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-02-07 17:04:43 +09:00
Stefano Brivio af0f10a227 pasta: Fix ICMPv6 Echo test, skip it for the moment
Similarly to the ICMP test for IPv4, I broke the command line on a
rebase of the initial test import.

Note that, unless we pass an IPv6 resolver directly to pasta, Podman
won't add one to /etc/resolv.conf in the container. We could pass
that explicitly, but then end up hitting the same issue as the one
described in the "Local forwarder, IPv6" case. Skip this test for
the moment being.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
Stefano Brivio 859579b6b7 pasta: Fix ICMP Echo Request (IPv4) test
Parameter substitution in the command line went lost on some rebase
of the initial test import. Add it back and actually test that we can
ping the resolver.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
Stefano Brivio e33f4e0bc7 pasta: Use two connections instead of three in TCP range forward tests
For some reason I couldn't figure out yet, on CI systems running
Fedora 37, tests for TCP port forwarding with ranges fail on the
third connection, as connect() from the socat client gets
interrupted -- and socat doesn't handle this.

Mitigate this by connecting twice, to two different ports, instead of
using three ports.

Reported-by: Ed Santiago <santiago@redhat.com>
Link: https://github.com/containers/podman/issues/17287
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
Daniel J Walsh acaab3fa72
Add SELinux label types support to quadlet
Add support for disabeling SELinux process separation in the container.
Add support for setting the process type of the container.
Add support for setting the process MCS level of the container.
Add support for setting the file type of the container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-06 12:54:34 -05:00
Daniel J Walsh 928d589b7e
Add quadlet support for rootfs= containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Add rootfs= support for quadlet containers

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-06 12:54:33 -05:00
OpenShift Merge Robot 51dd01c273
Merge pull request #17347 from sstosh/system-nonexistent-labels
system tests: fix noexistent labels test in the remote
2023-02-03 23:01:11 +01:00
OpenShift Merge Robot 5925baa33b
Merge pull request #17302 from rhatdan/selinux
Handle filetype field in kubernetes.yaml files
2023-02-03 22:45:08 +01:00
OpenShift Merge Robot 3654a26421
Merge pull request #17350 from giuseppe/allow-keep-id-for-root
libpod: allow userns=keep-id for root
2023-02-03 15:19:30 +01:00
Giuseppe Scrivano de63ad7044
libpod: allow userns=keep-id for root
copy the current mapping into a new user namespace, and run into a
separate user namespace.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-03 12:44:30 +01:00
OpenShift Merge Robot d8ef86a96e
Merge pull request #17325 from flouthoc/clean-cache-api
system-reset: use `CleanCacheMount` to clear build cache
2023-02-03 11:35:13 +01:00
OpenShift Merge Robot 90d338043d
Merge pull request #17343 from giuseppe/fix-cgroup-ro-test-cgroupv1
test: adapt test to work on cgroupv1
2023-02-03 11:10:54 +01:00
Aditya R 9e7f1bea42
system-reset: use CleanCacheMount to clear build cache
Just like buildkit buildah must allow cleaning the buildcache and cache generated on host by --mount=type=cache just like buildkit's prune command.

See: https://github.com/moby/buildkit#cache

Signed-off-by: Aditya R <arajan@redhat.com>
2023-02-03 12:30:28 +05:30
Toshiki Sonoda 3ce07b5567 system tests: fix noexistent labels test in the remote
In the remote environment, this test will be failed,
because an error message is different from the local environment.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-02-03 14:41:06 +09:00
OpenShift Merge Robot 78458e0f89
Merge pull request #17274 from giuseppe/idmap-rootfs
libpod: support idmap for --rootfs
2023-02-03 04:12:25 +01:00
Giuseppe Scrivano 2bb4c7cdde
libpod: support idmap for --rootfs
add a new option idmap to --rootfs that works in the same way as it
does for volumes.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-02 22:35:00 +01:00
Giuseppe Scrivano ed1f769176
test: adapt test to work on cgroupv1
when running on a cgroupv1 host validate that the memory controller is
mounted ro.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-02 20:41:57 +01:00
OpenShift Merge Robot e64508378f
Merge pull request #17327 from sstosh/system-vol-test
system tests: fix volume exec/noexec test
2023-02-02 19:50:47 +01:00
Daniel J Walsh 02bcf0bac8
Handle filetype field in kubernetes.yaml files
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-02 09:23:12 -06:00
Toshiki Sonoda 68371ff550 system tests: fix volume exec/noexec test
The return code is "126" in the current version of runc.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-02-02 18:18:28 +09:00
Ed Santiago f69efb6eef system tests: minor fix for RHEL8 incompatibility
quadlet tests were using 'systemctl show -P', a shortcut
that doesn't exist on RHEL8. Translate to old-systemd
language.

And, minor tweaks to make future test diagnosing easier.

This is a frontport of #17311; bringing from release branch
to main. Except that was an emergency, so it was a one-line
fix. This is a better long-term fix, not as trivial to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-01 16:12:39 -07:00
Toshiki Sonoda 9272cabd38 e2e: fix run_staticip_test about no_proxy
http.Get() could not recognize no_proxy with "ginkgo -nodes <any>".
Therefore, we set http.Client not to use a proxy instead of os.Setenv().

Fixes #17135

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-31 16:55:11 +09:00
Ed Santiago 0e3524b8b2 e2e tests: fix incorrect os.User.Name
Ha ha. This was supposed to be a trivial little followup to #17174:

   https://github.com/containers/podman/pull/17174#discussion_r1085963780
      (safer username check when --userns=keep-id)

It got complicated. TL;DR we need to use User.Username, not User.Name.
The latter is GECOS! Tests were working because, on Fedora, GECOS
for root is "root". Found and fixed all 'u.Name' instances, but
if there are any references with a variable other than 'u', they
still need looking into.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-30 13:54:10 -07:00
OpenShift Merge Robot 929d03a5ea
Merge pull request #17243 from sstosh/e2e-imagecachedir
e2e: Avoid hard-coding ImageCacheDir
2023-01-30 07:04:00 -05:00
Toshiki Sonoda 7e80edd3aa e2e: Avoid hard-coding included in quadlet test
Use .*/podman_test.*... instead of /tmp/podman_test.*...

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-30 11:45:34 +09:00
Toshiki Sonoda 2682d3ad9d e2e: Avoid hard-coding ImageCacheDir
- ImageCacheDir is hard-coded as "/tmp/podman/imagecachedir".
To avoid this hard-coding, I changed it to "os.TempDir()/imagecachedir".

- Change ImageCacheDir permissions from 0777 to 0700.
This directory should be used by per-user.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-30 10:14:08 +09:00
Jason T. Greene 553e53d441 Fix default handling of pids-limit
Add test to verify that updates without a pids-limit specified no longer
overwrite the previous value.

Also fixes erroneous warning generated by remote clients:

"Resource limits are not supported and ignored on cgroups V1 rootless
systems"

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-01-27 23:19:44 -06:00
OpenShift Merge Robot 986a3a61a8
Merge pull request #17182 from TomSweeneyRedHat/dev/tsweeney/fixlang3
Clean up more language for inclusiveness
2023-01-27 15:50:35 -05:00
OpenShift Merge Robot 14012491cf
Merge pull request #17088 from mtrmac/sign-by-sigstore
Add … push --sign-by-sigstore
2023-01-27 14:02:52 -05:00
Miloslav Trmač 069edc3adf Add (podman {image,manifest} push --sign-by-sigstore=param-file.yaml)
(podman push) and (podman manifest push) now support --sign-by-sigstore=param-file,
using the containers-sigstore-signing-params.yaml(5) file format.

That notably adds support for Fulcio and Rekor signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-01-27 16:47:32 +01:00
Toshiki Sonoda 21b82bb687 e2e: Remove the cache with "podman unshare rm" when a rootless user
If rootless, os.RemoveAll() is failed due to permission denied.
Therefore, we use "podman unshare rm" instead of os.RemoveAll().

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-27 23:44:04 +09:00
tomsweeneyredhat 9db657f40c Clean up more language for inclusiveness
We had a number of references, mostly in docs, to the word master that
can now be changed to main.  This PR does that and makes the project a
bit more inclusive.

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-01-27 09:40:27 -05:00
OpenShift Merge Robot a096e32ecc
Merge pull request #17251 from quite/status-up-not-ago
fix: don't output "ago" when container is currently up and running
2023-01-27 09:22:24 -05:00
Toshiki Sonoda 814f7c5695 e2e: Remove some directories at SynchronizedAfterSuite
"tempdir" in SynchronizedAftersuite and "LockTmpDir" can be removed.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-27 21:25:44 +09:00
Daniel Lublin 497be102ad fix: don't output "ago" when container is currently up and running
Closes #17250

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-01-27 12:32:15 +01:00
Valentin Rothberg a745d99a88 fix CI: test fail due to merge
containers/podman/pull/17186 and containers/podman/pull/17201 have been
merged at roughly the same time.  Both work fine in isolation but the
new kube test breaks in combination.

Fix the IPC kube test to make CI healthy.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-27 10:00:56 +01:00
OpenShift Merge Robot 49b809a0cc
Merge pull request #17186 from danishprakash/add-host-ipc
kube-play: add support for HostIPC in pod.Spec
2023-01-26 14:41:48 -05:00
OpenShift Merge Robot 532957eeff
Merge pull request #17217 from ygalblum/ygal-quadlet-blockdev-support
quadlet: Add device support for .volume files
2023-01-26 10:20:52 -05:00
OpenShift Merge Robot 4692b29145
Merge pull request #17208 from sstosh/e2e-tempfile
e2e: reduce dependency on /tmp for e2e tests
2023-01-26 10:00:08 -05:00
Toshiki Sonoda 38d5319f16 e2e: reduce dependency on /tmp for e2e tests
- Use filepath.Join(podmanTest.TempDir, "any") instead of "/tmp/any"

- Add generatePolicyFile() to avoid the hardcording of "keyPath": "tmp/key.gpg"

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-26 22:20:15 +09:00
Ingo Becker e62e42bfa9 quadlet: Add device support for .volume files
The Device, Type, Copy and Options keys are now supported in
quadlet  .volume files. This allows users to create filesystem
based volumes with quadlets .volume files.

Signed-off-by: Ingo Becker <ingo@orgizm.net>
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-26 14:46:57 +02:00
Aditya R 70e8f6243a
remote,build: error if containerignore is symlink
Drop support for remote use-cases when `.containerignore` or
`.dockerignore` is a symlink pointing to arbitrary location on host.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-26 16:11:51 +05:30
OpenShift Merge Robot 0184ba5d09
Merge pull request #17213 from umohnani8/nonroot
Set runAsNonRoot=true in gen kube
2023-01-26 05:03:07 -05:00
Paul Holzinger 9904fbed33
fix APIv2 python attach test flake
The test was added in commit 1424f0958f, it can flake because the
attach test needs the message in the log. On slow CI systems this can
take longer. Add a retry logic which checks the container log every
second for up to 5 seconds. That should be plenty of time.

Fixes #17204

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-25 14:15:20 +01:00
Urvashi Mohnani 958c94094e Set runAsNonRoot=true in gen kube
If the image being used has a user set that is a positive
integer greater than 0, then set the securityContext.runAsNonRoot
to true for the container in the generated kube yaml.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-01-25 17:14:22 +05:30
OpenShift Merge Robot 3cee9d9d98
Merge pull request #17201 from rhatdan/ipc
Correct output when inspecting containers created with --ipc
2023-01-24 17:29:29 -05:00
Daniel J Walsh 623ad2a636
Correct output when inspecting containers created with --ipc
Fixes: https://github.com/containers/podman/issues/17189

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-24 12:18:39 -05:00
Daniel J Walsh c4aae9b47e
Get correct username in pod when using --userns=keep-id
Fixes: https://github.com/containers/podman/issues/17148

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-24 11:06:06 -05:00
Aditya R b7ab889a7e
systems: retrofit dns options test to honor other search domains
Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-23 19:15:35 +05:30
danishprakash 08186d7dd7
kube-play: add support for HostIPC in pod.Spec
* play_kube_test: add tests

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-01-23 17:27:57 +05:30
Aditya R 06241077cc
libpod,netavark: correctly populate /etc/resolv.conf with custom dns server
After https://github.com/containers/netavark/pull/452 `netavark` is
incharge of deciding `custom_dns_servers` if any so lets honor that and
libpod should not set these manually.

This also ensures docker parity
Podman populates container's `/etc/resolv.conf` with custom DNS servers ( specified via `--dns` or `dns_server` in containers.conf )
even when container is connected to a network where `dns_enabled` is `true`.

Current behavior does not matches with docker, hence following commit ensures that podman only populates custom DNS server when container is not connected to any network where DNS is enabled and for the cases where `dns_enabled` is `true`
the resolution for custom DNS server will happen via ( `aardvark-dns` or `dnsname` ).

Reference: https://docs.docker.com/config/containers/container-networking/#dns-services
Closes: containers#16172

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-22 12:48:55 +05:30
OpenShift Merge Robot 8252dcceb3
Merge pull request #17168 from danishprakash/add-host-pid
kube-play: add support for HostPID
2023-01-20 11:57:14 -05:00
OpenShift Merge Robot 4f4dce166c
Merge pull request #17175 from Luap99/default-invalid-netname
network create: do not allow `default` as name
2023-01-20 11:18:01 -05:00
OpenShift Merge Robot 9c79e3bbb0
Merge pull request #17124 from sstosh/e2e-rootless
e2e: use isRootless() instead of rootless.IsRootless()
2023-01-20 09:04:25 -05:00
Paul Holzinger 86699954b1
network create: do not allow `default` as name
`default` is already used as network mode, i.e. podman run --network
default will choose the default mode not a network named `default`.

We already block names from other network modes, default was forgotten.

Fixes #17169

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-20 14:52:07 +01:00
danishprakash 3ae84fe0a3
kube-play: add support for HostPID in podSpec
* test/play_kube: add tests for hostPID

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-01-20 17:32:59 +05:30
Ed Santiago ca91cf416f Let's see if #14653 is fixed or not
Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-19 12:20:56 -07:00
OpenShift Merge Robot 7689e26c79
Merge pull request #16525 from Luap99/CI-update-image
update CI images to include pasta
2023-01-19 11:30:46 -05:00
Paul Holzinger 7be8ff5644
unskip network update test
They should work with the new VM images.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-19 15:44:17 +01:00
Paul Holzinger 2ad938ec6e
pasta: skip "Local forwarder, IPv4" test
It is not working in CI and locally, I filed #17074 to track it so we
can fix it later.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-19 15:44:17 +01:00
Ed Santiago 07d297ca3d Cirrus: preserve podman-server logs
Output from podman system service, on system tests, is
being saved... it just hasn't been collected as an artifact.
Start collecting it. And, remove obsolete-unused-misleading
code that made me think it _was_ being collected.

Also: log system-service output for bud tests, and set
log-level to info per suggestion from @Luap99

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-19 06:27:43 -07:00
Ed Santiago 51836aa47c e2e tests: reenable long-skipped build test
July 2022: test was flaking on new VM images. We needed new
images, so I filed #15014 and skipped the test.

January 2023: no attention from anyone, so I'll try bumping up
a dd timeout from 10s to 30s. But in the interim, the test
has broken: it used to expect "Containerfile" in output (this
was deliberately added in #13655)... but #16810 changed that
so Containerfile no longer appears. @flouthoc argues that
this too is deliberate (#17059). Okay, so let's change the
test then. All I care about is not adding more regressions.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-18 17:31:03 -07:00
Daniel J Walsh ef3f098796
Remove ReservedAnnotations from kube generate specification
Reserved annotations are used internally by Podman and would effect
nothing when run with Kubernetes so we should not be generating these
annotations.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-18 08:46:24 -05:00
Toshiki Sonoda 6d3858b21e e2e: update test/README.md
All ginkgo test must be run with the remote build tag.
See #16322 for details.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-18 10:35:19 +09:00