Commit Graph

5133 Commits

Author SHA1 Message Date
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
Toshiki Sonoda 17b5bd758d e2e: use isRootless() instead of rootless.IsRootless()
Unify the functions used to detect rootless to "isRootless()".
This function can detect to join the user namespace by mistake.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-18 10:34:51 +09:00
Ed Santiago dc2bd0857d sig-proxy system test: bump timeout
...and instrument with 'podman ps'es for debugging failures.

Test flakes pretty regularly in Fedora gating. If the increased
timeout doesn't help, at least we should be able to see if the
container is stopping or failed or something.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-17 08:21:39 -07:00
OpenShift Merge Robot cf40adb3df
Merge pull request #17118 from giuseppe/rename-auth-scripts-to-preexec-hooks
rootless: rename auth-scripts to preexec-hooks
2023-01-17 09:53:25 -05:00
Giuseppe Scrivano a581d2a041
rootless: rename auth-scripts to preexec-hooks
to not give a false sense of security since these are not a security
mechanism but a hook to run arbitrary code before executing a
command.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-01-17 10:58:46 +01:00
Martin Roukala (né Peres) 70057c8b47
Make rootless privileged containers share the same tty devices as rootfull ones
Until Podman v4.3, privileged rootfull containers would expose all the
host devices to the container while rootless ones would exclude
`/dev/ptmx` and `/dev/tty*`.

When 5a2405ae1b ("Don't mount /dev/tty* inside privileged containers
running systemd") landed, rootfull containers started excluding all the
`/dev/tty*` devices when the container would be running in systemd
mode, reducing the disparity between rootless and rootfull containers
when running in this mode.

However, this commit regressed some legitimate use cases: exposing
non-virtual-terminal tty devices (modems, arduinos, serial
consoles, ...) to the container, and the regression was addressed in
f4c81b0aa5 ("Only prevent VTs to be mounted inside privileged
systemd containers").

This now calls into question why all tty devices were historically
prevented from being shared to the rootless non-privileged containers.
A look at the podman git history reveals that the code was introduced
as part of ba430bfe5e ("podman v2 remove bloat v2"), and obviously
was copy-pasted from some other code I couldn't find.

In any case, we can easily guess that this check was put for the same
reason 5a2405ae1b was introduced: to prevent breaking the host
environment's consoles. This also means that excluding *all* tty
devices is overbearing, and should instead be limited to just virtual
terminals like we do on the rootfull path.

This is what this commit does, thus making the rootless codepath behave
like the rootfull one when in systemd mode.

This leaves `/dev/ptmx` as the main difference between the two
codepath. Based on the blog post from the then-runC maintainer[1] and
this Red Hat bug[2], I believe that this is intentional and a needed
difference for the rootless path.

Closes: #16925
Suggested-by: Fabian Holler <mail@fholler.de>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>

[1]: https://www.cyphar.com/blog/post/20160627-rootless-containers-with-runc
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=501718
2023-01-16 16:23:53 +02:00
OpenShift Merge Robot cdcd2eddc7
Merge pull request #17107 from vrothberg/fix-17016
kube play: complete container spec
2023-01-14 11:19:07 -05:00
OpenShift Merge Robot ae674a3c7c
Merge pull request #17082 from dcermak/warn-about-replicas
Warn about creating multiple replicas from kubernetes YAML
2023-01-14 11:08:46 -05:00
OpenShift Merge Robot 64988ad287
Merge pull request #17108 from vrothberg/fix-17093
fix flake in kube system test
2023-01-13 21:46:50 -05:00
OpenShift Merge Robot e1828873e7
Merge pull request #17018 from sstosh/e2e-systemd-acrivate
e2e: fix systemd_activate_test
2023-01-13 15:45:03 -05:00
Valentin Rothberg 4bb69abd5f fix flake in kube system test
Increase the loop range from 5 to 20 to make sure we give the service
enough time to transition to inactive.  Other tests have the same range
with 0.5 seconds sleeps, so I expect the new value to be sufficient and
consistent.

Fixes: #17093
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-13 15:38:50 +01:00
Valentin Rothberg 9a206fdc9f kube play: complete container spec
Make sure that the specs of containers generated by `kube play` are
correctly completed.  They have not before which surfaced in default
environment variables not being set.

Fixes: #17016
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-13 15:18:11 +01:00
OpenShift Merge Robot e473c93e94
Merge pull request #17072 from edsantiago/refactor_700
podman-play system test: refactor
2023-01-13 08:30:18 -05:00
OpenShift Merge Robot ceeeea874d
Merge pull request #17102 from ygalblum/kube-port-test-inspect
E2E Tests: Use inspect instead of actual data to avoid UDP flake
2023-01-13 03:49:54 -05:00
Ygal Blum a02a10f3f3 E2E Tests: Use inspect instead of actual data to avoid UDP flake
Do not test using an unreliable UDP connection

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-13 07:37:06 +02:00
Dan Čermák d9bf3f1290
Limit replica count to 1 when deploying from kubernetes YAML
This fixes: https://github.com/containers/podman/issues/16765

Signed-off-by: Dan Čermák <dcermak@suse.com>
2023-01-12 23:25:35 +01:00
Matthew Heon 1ab833fb73 Set StoppedByUser earlier in the process of stopping
The StoppedByUser variable indicates that the container was
requested to stop by a user. It's used to prevent restart policy
from firing (so that a restart=always container won't restart if
the user does a `podman stop`. The problem is we were setting it
*very* late in the stop() function. Originally, this was fine,
but after the changes to add the new Stopping state, the logic
that triggered restart policy was firing before StoppedByUser was
even set - so the container would still restart.

Setting it earlier shouldn't hurt anything and guarantees that
checks will see that the container was stopped manually.

Fixes #17069

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-01-12 14:45:34 -05:00
Ed Santiago 6ab8834480 podman-play system test: refactor
The kube-play test file was a rat's nest of long complicated
yaml strings all differing only slightly. Clean it up, by
adding a helper function with optional parameters. The
helper is ugly, but the actual test code (the important
stuff) is cleaner.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-12 12:28:48 -07:00
OpenShift Merge Robot b107d7720a
Merge pull request #16732 from flouthoc/network-update
network: add support for `podman network update` and `--network-dns-server`
2023-01-12 12:18:14 -05:00
Aditya R 882cd17f83
network: add support for podman network update and --network-dns-server
* Add support for `podman network update <>`

```console
network update

Description:
  update networks for containers and pods

Usage:
  podman network update [options] NAME

Examples:
  podman network update podman1

Options:
      --dns-add stringArray      add network level nameservers
      --dns-drop stringArray   remove network level nameservers
```

* Add support for `--network-dns-server` to `podman network create`

Extends podman to support recently added features in `netavark` and
`aardvark-dns`

* https://github.com/containers/netavark/pull/497
* https://github.com/containers/aardvark-dns/pull/252
* https://github.com/containers/netavark/pull/503

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-12 20:19:14 +05:30
Valentin Rothberg d2fb6cf05d service container: less verbose error logs
While manually playing with --service-container, I encountered a number
of too verbose logs.  For instance, there's no need to error-log when
the service-container has already been stopped.

For testing, add a new kube test with a multi-pod YAML which will
implicitly show that #17024 is now working.

Fixes: #17024
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-12 14:09:23 +01:00
Ygal Blum b10a906b5c Quadlet Kube - add support for PublishPort key
Move the handling of Publish key to a method
use --publish instead of -p
Use the new method for both .container and .kube files
Adjust .container tests
Add .kube tests
Update the man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-12 10:19:14 +02:00
OpenShift Merge Robot a7ba63dede
Merge pull request #17055 from mupuf/mount-non-vt-tty
Only prevent VTs to be mounted inside privileged systemd containers
2023-01-11 20:59:26 -05:00
Toshiki Sonoda ad12d61c66 e2e: fix systemd_activate_test
- When SELinux is enabled, a storage root directory
should be labeled with a specific value.

- `stop podman.service` test changes a storage root directory,
therefore we need to cleanup a container with --root option.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-12 09:53:15 +09:00
OpenShift Merge Robot 39ffcb8c31
Merge pull request #17064 from Romain-Geissler-1A/docker-compat-networkmode
[docker compat] Don't overwrite the NetworkMode from "default" to "bridge" if containers.conf specifies a non-default configuration.
2023-01-11 18:44:15 -05:00
OpenShift Merge Robot 1e451031ff
Merge pull request #17067 from sstosh/e2e-play-kube
e2e: fix play_kube_test
2023-01-11 14:31:40 -05:00
OpenShift Merge Robot 8a0d25f673
Merge pull request #17083 from ygalblum/kube-port-test-set-deadline
E2E Test: Play Kube set deadline to connection to avoid hangs
2023-01-11 13:50:51 -05:00
OpenShift Merge Robot f70233aa08
Merge pull request #16951 from ygalblum/system-test-quadlet-network
System tests: quadlet network test
2023-01-11 13:19:01 -05:00
Romain Geissler 3e2b9a28da [docker compat] Don't overwrite the NetworkMode if containers.conf overrides netns.
Fixes #16915 (only the part about docker client).

Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
2023-01-11 17:44:09 +00:00
Ygal Blum 5b1bdf9490 E2E Test: Play Kube set deadline to connection to avoid hangs
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-11 18:56:45 +02:00
Martin Roukala (né Peres) f4c81b0aa5 Only prevent VTs to be mounted inside privileged systemd containers
While mounting virtual console devices in a systemd container is a
recipe for disaster (I experienced it first hand), mounting serial
console devices, modems, and others should still be done by default
for privileged systemd-based containers.

v2, addressing the review from @fho:
 - use backticks in the regular expression to remove backslashes
 - pre-compile the regex at the package level
 - drop IsVirtualTerminalDevice (not needed for a one-liner)

v3, addressing the review from @fho and @rhatdan:
 - re-introduce a private function for matching the device names
 - use path.Match rather than a regex not to slow down startup time

Closes #16925.

Fixes: 5a2405ae1b ("Don't mount /dev/tty* inside privileged...")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
2023-01-11 16:57:58 +02:00
Toshiki Sonoda a5ce3b3cd7 e2e: fix play_kube_test
When SELinux is enabled, e2e test could be failed
due to run a ls command in a running container.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-11 14:28:24 +09:00
OpenShift Merge Robot 382c55eeaa
Merge pull request #17038 from ygalblum/quadlet-kube-configmap
Quadlet: Add support for ConfigMap key in Kube section
2023-01-10 22:20:55 -05:00
Daniel J Walsh 7c95a5df92
Merge pull request #17053 from edsantiago/ditch_wwwpodmanio
Network tests: ping redhat.com, not podman.io
2023-01-10 15:07:28 -05:00
Daniel J Walsh 619933a530
Merge pull request #17041 from vrothberg/post-run
cobra: move engine shutdown to Execute
2023-01-10 12:59:17 -05:00
OpenShift Merge Robot 6ba308f075
Merge pull request #16880 from ygalblum/kube-publish-ports
Kube Play - allow setting and overriding published host ports
2023-01-10 11:49:36 -05:00
Ed Santiago 37ade6be12 Network tests: ping redhat.com, not podman.io
Much as we'd love to eat our dogfood, podman.io is not hosted
on reliable infrastructure; redhat.com is. Let's see if this
gets rid of CI flakes.

Closes: #17044

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-10 05:38:43 -07:00
Valentin Rothberg 2d8225cd44 cobra: move engine shutdown to Execute
If the run errors, cobra does not execute post runs.  It is a somehow
known issue (https://github.com/spf13/cobra/issues/914) but problematic
for Podmand as the runtime is shutdown during post run.

Since some commands overwrite the post run and a general lack in cobra
of post runs on errors, move the shutting down the engines directly into
Execute.  Fixing the issue may fix a number of flakes.

Note that the shutdowns are NOPs for the remote client.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-10 13:30:41 +01:00
OpenShift Merge Robot 5b9e068950
Merge pull request #17040 from giuseppe/podman-rm-f-no-processes
podman: podman rm -f doesn't leave processes
2023-01-10 05:11:00 -05:00
Giuseppe Scrivano 4cf06fe7e0
podman: podman rm -f doesn't leave processes
follow-up to 6886e80b45

when "podman -rm -f" is used on a container in "stopping" state, also
make sure it is terminated before removing it from the local storage.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-01-09 21:01:32 +01:00
Giuseppe Scrivano cf364703fc
linux: add /sys/fs/cgroup if /sys is a bind mount
if /sys is bind mounted from the host then also add an explicit mount
for /sys/fs/cgroup so that 'ro' is honored.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-01-09 19:42:51 +01:00
OpenShift Merge Robot 1da081f289
Merge pull request #17017 from edsantiago/ditch_ubi
e2e tests: stop using UBI images
2023-01-09 10:25:43 -05:00
Ygal Blum 1bd3d32c5f Quadlet: Add support for ConfigMap key in Kube section
For each instance of ConfigMap pass the path via --configmap
Add tests
Add to doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-09 14:58:31 +02:00
Valentin Rothberg 4a7a45f973 remove service container _after_ pods
Do not allow for removing the service container unless all associated
pods have been removed.  Previously, the service container could be
removed when all pods have exited which can lead to a number of issues.

Now, the service container is treated like an infra container and can
only be removed along with the pods.

Also make sure that a pod is unlinked from the service container once
it's being removed.

Fixes: #16964
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-09 13:44:51 +01:00
OpenShift Merge Robot bc6908e761
Merge pull request #17014 from rhatdan/VENDOR
Vendor in latest containers/common
2023-01-09 03:46:16 -05:00
Ygal Blum 07cc49efdb Kube Play - allow setting and overriding published host ports
Add a new flag --publish
Remote - Pass PublishPorts as a string array
ABI - translate the string array to Ports and merge with the ports in the spec
Add e2e tests
Add option to man doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-08 13:49:53 +02:00
OpenShift Merge Robot 5de8cd74f9
Merge pull request #16820 from rhatdan/names
Allow '/' to prefix container names to match Docker
2023-01-07 09:38:19 -05:00
Daniel J Walsh e332b6246b
Vendor in latest containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-06 14:19:47 -05:00
OpenShift Merge Robot 6f4eafe37c
Merge pull request #16992 from Luap99/log-since
several podman logs fixes
2023-01-06 12:05:34 -05:00
Ed Santiago e82045f73c e2e tests: stop using UBI images
Red Hat registry is too unreliable. (As of this writing
in January 2023, quay.io is not much better, but this is
a new flake. Ubi has been flaking for a year or more).

Instead of UBI, use the new systemd-image added to system tests
in #16814. Since this reduces the number of cached images,
a few unrelated tests (image count) need to be tweaked.

And, sigh, Fedora systemd colorizes boot messages by default,
causing a failure where we don't see an expected Reached Target
message. I don't want to rely on ASCII formatting codes, so
I've updated the build-systemd-image script so it disables
systemd colors, and have built a new systemd-image:20230106.
Made a few small usability improvements to the script as well.

Closes: #16695

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-06 08:21:50 -07:00
OpenShift Merge Robot 609df3ec32
Merge pull request #17002 from containers/dependabot/go_modules/test/tools/golang.org/x/tools-0.5.0
Bump golang.org/x/tools from 0.4.0 to 0.5.0 in /test/tools
2023-01-06 09:40:41 -05:00
Paul Holzinger 6038200fe0
k8s-file: podman logs --until --follow exit after time
When you use podman logs with --until and --follow it should exit after
the requested until time and not keep hanging forever.

This fixes the behavior for the k8s-file backend.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-06 15:19:23 +01:00
Paul Holzinger 767947ab88
journald: podman logs --until --follow exit after time
When you use podman logs with --until and --follow it should exit after
the requested until time and not keep hanging forever.

To make this work I reworked the code to use the better journald event
reading code for logs as well. this correctly uses the sd_journal API
without having to compare the cursors to find the EOF.

The same problems exists for the k8s-file driver, I will fix this in the
next commit.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-06 15:19:22 +01:00
Paul Holzinger 5f032256db
podman logs: journald fix --since and --follow
The `containerCouldBeLogging` bool should not be false by default, when
--since is used we seek in the journal and can miss the start event so
that bool would stay false forever. This means that a running container
is not followed even when it should.

To fix this we can just set the `containerCouldBeLogging` bool based on
the current contianer state.

Fixes #16950

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-06 15:19:16 +01:00
OpenShift Merge Robot b7314bdc68
Merge pull request #16806 from jakecorrenti/podman-inspect-add-error-info
Add container error message to ContainerState
2023-01-05 16:02:42 -05:00
OpenShift Merge Robot 7f3dd309c6
Merge pull request #16989 from sstosh/fix-e2e
e2e: fix run_volume_test
2023-01-05 13:56:42 -05:00
dependabot[bot] 4587e7fdb4
Bump golang.org/x/tools from 0.4.0 to 0.5.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.4.0...v0.5.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-01-05 18:54:13 +00:00
Daniel J Walsh d0c89e90bf
Describe copy volume options
Fixes: https://github.com/containers/podman/issues/16961

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-04 14:58:51 -05:00
OpenShift Merge Robot 49075c3813
Merge pull request #16985 from ashley-cui/attachsig
Support sig-proxy for podman-remote attach and start
2023-01-04 13:15:29 -05:00
Ashley Cui bfdffb5b62 Support sig-proxy for podman-remote attach and start
Signals were not proxied for attach and start for podman-remote. Now
they are.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-04 09:38:17 -05:00
OpenShift Merge Robot ff9d1c1309
Merge pull request #16978 from giuseppe/fix-race-condition-podman-rm-stopping
libpod: fix race condition rm'ing stopping containers
2023-01-04 07:14:33 -05:00
Giuseppe Scrivano 6886e80b45
libpod: fix race condition rm'ing stopping containers
do not allow removing containers that are in the stopping state,
otherwise it can lead to a race condition where a "podman rm" removes
the container from the storage while another process is stopping the
same container.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2155828

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-01-04 08:53:19 +01:00
Toshiki Sonoda fb73121c4c e2e: fix run_volume_test
When SELinux is running in enforcing mode,
this test needs to add an suffix :Z to the volume mount.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-04 15:34:37 +09:00
OpenShift Merge Robot b2da34e57d
Merge pull request #16980 from vrothberg/fix-kube
kube play: fix the error logic with --quiet
2023-01-03 14:04:04 -05:00
OpenShift Merge Robot f2881afd21
Merge pull request #16926 from odra/quadlet-lint
Quadlet -dryrun arg
2023-01-03 14:00:59 -05:00
Jake Correnti df02cb51ee Add container error message to ContainerState
This change aims to store an error message to the ContainerState struct
with the last known error from the Start, StartAndAttach, and Stop OCI
Runtime functions.

The goal was to act in accordance with Docker's behavior.

Fixes: #13729

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-01-03 13:21:24 -05:00
OpenShift Merge Robot 28d04bc524
Merge pull request #16934 from SamirPS/fix-volume
Fix: List container with volume filter
2023-01-03 12:33:19 -05:00
Valentin Rothberg 03c7f47aa8 kube play: fix the error logic with --quiet
Fix a bug where kube play would print format errors such as
`Error: %!s(<nil>)`.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-03 17:39:03 +01:00
Ygal Blum 9f0a37cd47 System tests: quadlet network test
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-03 17:25:58 +02:00
OpenShift Merge Robot a4edd0d310
Merge pull request #16971 from ygalblum/quadlet-network-depend
Quadlet Network - Fix the name of the required network service
2023-01-03 10:17:25 -05:00
OpenShift Merge Robot 66ec8aa5d4
Merge pull request #16962 from jakecorrenti/update-pids-limit
Fixed `podman update --pids-limit`
2023-01-03 10:14:52 -05:00
SamirPS e479644177 Fix: List container with volume filter
Modify the condition in line 149 in order to list container by mounting
point.
Closes #16019

Signed-off-by: SamirPS <akariohsamir@yahoo.com>
2023-01-03 15:56:29 +01:00
OpenShift Merge Robot 2dd9e0859c
Merge pull request #16947 from ygalblum/kube-service-container-logdriver
Kube Play: use passthrough as the default log-driver if service-container is set
2023-01-03 09:28:00 -05:00
OpenShift Merge Robot 535d4d4779
Merge pull request #16887 from cdoern/subpath
Add support for hostPath and configMap subpath usage
2023-01-03 09:05:11 -05:00
OpenShift Merge Robot 74e8654681
Merge pull request #16953 from ygalblum/quadlet-container-env
Quadlet Container: Add support for EnvironmentFile and EnvironmentHost
2023-01-03 09:02:22 -05:00
OpenShift Merge Robot 864288b8da
Merge pull request #16970 from ygalblum/system-test-quadlet-volume-depend
System Test Quadlet - Volume dependency test did not test the dependency
2023-01-03 07:50:16 -05:00
Leonardo Rossetti cd3492304e
adding -dryrun flag
Signed-off-by: Leonardo Rossetti <lrossett@redhat.com>
2023-01-03 09:19:48 -03:00
OpenShift Merge Robot d070d5f725
Merge pull request #16963 from ygalblum/system-test-readme-hack
[CI:DOCS] Test README - point users to hack/bats
2023-01-03 07:14:42 -05:00
Ygal Blum 347d5372e1 Quadlet Container: Add support for EnvironmentFile and EnvironmentHost
Add the new keys to the supported keys list for the Container group
Pass the list of EnvironmentFile values while maintaining the order
Quadlet e2e test framework: Add support for checking regex in Podman args
Add relevant tests
Update man

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-03 13:14:31 +02:00
OpenShift Merge Robot e332a244e3
Merge pull request #16974 from edsantiago/bats_cleanup
[minor] System tests: add missing cleanup
2023-01-03 04:52:28 -05:00
OpenShift Merge Robot 4c2151698e
Merge pull request #16972 from edsantiago/fix_unquoted_glob
System tests: fix unquoted question marks
2023-01-03 04:49:57 -05:00
OpenShift Merge Robot ee01ae1079
Merge pull request #16814 from edsantiago/build-systemd-testimage
Build and use a newer systemd image
2023-01-03 04:47:20 -05:00
Ygal Blum 68fbebfacc Kube Play: use passthrough as the default log-driver if service-container is set
Reasoning
---------
When the log-driver is passthrough, the journal socket is passed to the containers as-is which has two advantages:
1. journald can see who the actual sender of the log event is,
    rather than thinking everything comes from the conmon process
2. conmon will not have to copy all the log data

Code Changes
------------
If log-driver was not set by the user and service-container is set use
passthrough as the default log-driver

Update the system tests
- explicitly set logdriver in sdnotify and play tests
- podman-kube template test:  Verify the default log driver for service-container

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-03 10:34:24 +02:00
Ed Santiago 635c008405 System tests: add missing cleanup
New tests got added since I've been on PTO. Some of those tests
weren't doing cleanup, resulting in nasty red logs. Fix.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-02 14:19:48 -07:00
Ed Santiago 8e77f4c993 System tests: fix unquoted question marks
In 'run_podman ? ...', the question mark will _usually_ be
interpreted as a literal question mark, meaning "ignore
exit status". But if there are one or more single-character
filenames in the working directory, such as droppings from
a command such as 'my-test-command > a', Very Bad Things
will happen: the test will fail with an incomprehensible
error message. Prevent that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-02 14:13:47 -07:00
OpenShift Merge Robot ecbb52cb47
Merge pull request #16929 from vrothberg/fix-16916
fix `podman system connection - tcp` flake
2023-01-02 16:12:15 -05:00
Ed Santiago 16b595c32c Build and use a newer systemd image
...based on f37, not f31. And make it fedora-minimal so it's
smaller. And clean up dnf so it's even smaller. And tag it
with our proper YMD tag, and commit the script that builds it.

This broke the system-df tests. In the process of resolving
that, I found those tests a little lacking. So, improve their
coverage a little bit.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-01-02 13:26:46 -07:00
Ygal Blum a061d793df Quadlet Network - Fix the name of the required network service
The name of the network service does not start with systemd only the
podman network name

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-02 14:55:56 +02:00
Ygal Blum 3ebb822e21 System Test Quadlet - Volume dependency test did not test the dependency
Make sure the Container unit correctly references the volume
Start the Container service and not the Volume one
Remove the volume
Print the name of the service when status does not match

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-02 14:31:42 +02:00
OpenShift Merge Robot fa7042f12f
Merge pull request #16946 from sstosh/fix-e2e
e2e: fix containers_conf_test
2023-01-02 05:10:50 -05:00
OpenShift Merge Robot 94c9251864
Merge pull request #16810 from flouthoc/trim-path-correctly
podman-remote,bindings: trim context path correctly when its `emptydir`
2023-01-02 05:07:31 -05:00
Valentin Rothberg a741299efc fix `podman system connection - tcp` flake
The test was only waiting for the port to be ready but that doesn't
imply the server being ready to serve requests.  Hence, add a loop
waiting for the `info` call to succeed.

Fixes: #16916
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-02 10:22:06 +01:00
Ygal Blum 18b21b89c8 Test README - point users to hack/bats
Let users know they can use hack/bats to control the system tests they
are running

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-01 08:37:03 +02:00
Ygal Blum 2000c4c80e System test: quadlet kube basic test
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-01 08:20:52 +02:00
Jake Correnti 479052afa6 Fixed `podman update --pids-limit`
Added the functionality for a user to update the PIDs limit for a
container.

Fixes: #16543

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2022-12-31 18:42:47 -05:00
Aditya R 553df8748b
podman-remote,bindings: trim context path correctly when its emptydir
podman-remote converts and sends absolute path as context when its an
emptydir by adding additional seperator however it should correctly trim
the path and not add additional seperator for such use cases.

Closes: BZ#2145054

Signed-off-by: Aditya R <arajan@redhat.com>
2022-12-30 20:38:54 +05:30
Toshiki Sonoda 200f86edea e2e: fix containers_conf_test
Prevents overwriting of TMPDIR environment.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-12-27 18:20:42 +09:00
Daniel J Walsh 0c94f61852
Allow '/' to prefix container names to match Docker
Fixes: https://github.com/containers/podman/issues/16663

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-26 07:37:43 -05:00
OpenShift Merge Robot 4a57cfb926
Merge pull request #16545 from rhatdan/read-only
Add containers.conf read-only flag support
2022-12-25 07:56:23 -05:00
OpenShift Merge Robot e000f8509f
Merge pull request #16907 from vrothberg/refactor
infra/abi: refactor ContainerRm
2022-12-23 05:18:13 -05:00
OpenShift Merge Robot 9fbf91801d
Merge pull request #16904 from rhatdan/system
Output Size and Reclaimable in human form for json output
2022-12-22 13:49:17 -05:00