17705 Commits

Author SHA1 Message Date
120d16b616 Bump to v4.4.0-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-17 12:15:19 -05:00
24cc02a64e Bump to v4.4.0-rc2
Signed-off-by: Ashley Cui <acui@redhat.com>
v4.4.0-rc2
2023-01-17 12:14:25 -05:00
ddf8e49891 Vendor in latest c/common
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-17 12:12:17 -05:00
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
7093d1fe5c Merge pull request #17130 from Luap99/remove-dup-code
commit: use libimage code to parse changes
2023-01-17 05:10:22 -05:00
abfca47d32 Merge pull request #17127 from mupuf/tty_devices_for_all
Make rootless privileged containers share the same tty devices as rootfull ones
2023-01-17 05:07:56 -05:00
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
07ba51d77a Merge pull request #17133 from cevich/docs_update
Docs: version-check updates
2023-01-16 16:44:26 -05:00
bdf1001790 Docs: version-check updates
Signed-off-by: Chris Evich <cevich@redhat.com>
2023-01-16 15:33:05 -05:00
942ac3de17 Merge pull request #17128 from baude/deprecateexperimental
[CI:DOCS] Remove experimental mac tutorial
2023-01-16 14:56:30 -05:00
f07cee3241 Merge pull request #17126 from vrothberg/fix-16142
container kill: handle stopped/exited container
2023-01-16 13:24:09 -05:00
79865c2903 commit: use libimage code to parse changes
This code is duplicated in podman and c/common, we should only use one
version.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-16 16:28:11 +01:00
bdc323cbfa [CI:DOCS] Remove experimental mac tutorial
This doc is no longer applicable.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-01-16 08:26:15 -06:00
8db2b4b733 man: Document the interaction between --systemd and --privileged
Users need to know about this side effect.

Fixes: 5a2405ae1b3a ("Don't mount /dev/tty* inside privileged...")
Fixes: f4c81b0aa5fd ("Only prevent VTs to be mounted inside ...")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
2023-01-16 16:23:53 +02:00
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 5a2405ae1b3a ("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
f4c81b0aa5fd ("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 ba430bfe5ef6 ("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 5a2405ae1b3a 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
067442b570 container kill: handle stopped/exited container
The container lock is released before stopping/killing which implies
certain race conditions with, for instance, the cleanup process changing
the container state to stopped, exited or other states.

The (remaining) flakes seen in #16142 and #15367 strongly indicate a
race in between the stopping/killing a container and the cleanup
process.  To fix the flake make sure to ignore invalid-state errors.
An alternative fix would be to change `KillContainer` to not return such
errors at all but commit c77691f06f61 indicates an explicit desire to
have these errors being reported in the sig proxy.

[NO NEW TESTS NEEDED] as it's a race already covered by the system
tests.

Fixes: #16142
Fixes: #15367
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-16 13:56:41 +01:00
d558a792f4 Merge pull request #17084 from cevich/fix_main_benchmark_fail
Cirrus: Run machine tests on PR merge
2023-01-16 06:57:56 -05:00
6f919af78b add a comment to container removal
Every time I look at a container-removal issue I wonder why the
container isn't locked directly here, so let's add a comment here.
I am not sure whether I would be better if callers took care of
locking but for now the comment will safe the future me and probably
other readers some time.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-16 11:45:19 +01:00
8114cc7f75 Merge pull request #17121 from rhatdan/VENDOR
Vendor in latest containers/storage
2023-01-16 04:36:47 -05:00
5ac5aaa723 Vendor in latest containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-15 07:41:30 -05:00
cdcd2eddc7 Merge pull request #17107 from vrothberg/fix-17016
kube play: complete container spec
2023-01-14 11:19:07 -05:00
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
64988ad287 Merge pull request #17108 from vrothberg/fix-17093
fix flake in kube system test
2023-01-13 21:46:50 -05:00
e1828873e7 Merge pull request #17018 from sstosh/e2e-systemd-acrivate
e2e: fix systemd_activate_test
2023-01-13 15:45:03 -05:00
daf747f169 Cirrus: Run machine tests on PR merge
Prior to this commit, the podman-machine tests only ran for PRs.
However, now that these tasks are also being used to capture a uniform
set of performance benchmarks, they should probably run on branches as
well.  This also fixes a stream of branch-CI run failures due to the
artifacts-task failing to download/archive (missing) benchmark data.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-01-13 15:13:39 -05:00
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
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
e473c93e94 Merge pull request #17072 from edsantiago/refactor_700
podman-play system test: refactor
2023-01-13 08:30:18 -05:00
f1af5b3076 Merge pull request #17100 from rhatdan/regexp
Use containers/storage/pkg/regexp in place of regexp
2023-01-13 04:19:29 -05:00
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
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
93118464d4 Merge pull request #16816 from cevich/nvav_update_ondemand
[CI:DOCS] Cirrus: Support using updated/latest NV/AV in PRs
2023-01-12 21:21:58 -05:00
3e229b0bd5 Merge pull request #17077 from mheon/set_stopping_early
Set StoppedByUser earlier in the process of stopping
2023-01-12 18:37:19 -05:00
c2b36beb40 Use containers/storage/pkg/regexp in place of regexp
This is a cleaner solution and guarantees the variables
will be used before they are initialized.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-12 18:33:38 -05:00
c433982d18 Vendor in latest containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-12 18:21:29 -05:00
11835d5d0c Cirrus: Support using updated/latest NV/AV in PRs
On occasion, developers need to run the latest or bleeding-edge
netavark/aardvark-dns in the podman CI environment.  Enable this through
use of magic strings in the PR title, but only if the PR is marked as a
draft.  The intent being, when the PR is ready for review, the current
CI VM package versions will be used.  Hopefully also reminding the PR
author to remove the magic strings from the title, remove draft status,
and push the final set of changes to be merged.

Also, add documentation about this new magic PR title string and CI's
behaviors.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-01-12 17:30:24 -05:00
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
f15b1f5211 Merge pull request #17095 from ashley-cui/44rc1
Bump to v4.4.0-RC1
2023-01-12 15:59:32 -05:00
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
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
470b680770 Bump to v4.4.0-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-12 13:38:05 -05:00
d8774a93c3 Bump to v4.4.0-RC1
Signed-off-by: Ashley Cui <acui@redhat.com>
v4.4.0-rc1
2023-01-12 13:37:18 -05:00
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
5cb4fe3e41 Merge pull request #17058 from vrothberg/fix-17024
service container: less verbose error logs
2023-01-12 11:30:30 -05:00
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
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
4bbe2ee012 Merge pull request #17068 from ygalblum/quadlet-kube-publish-ports
Quadlet Kube - add support for PublishPort key
2023-01-12 07:12:05 -05:00
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
67305cec97 Merge pull request #17060 from sabre1041/volumesource-error-msg
Updated error message for supported VolumeSource types
2023-01-11 21:02:01 -05:00
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