Commit graph

18551 commits

Author SHA1 Message Date
Paul Holzinger
9558af2c4c
libpod: stop containers with --restart=always
Commit 1ab833fb73 improved the situation but it is still not enough.
If you run short lived containers with --restart=always podman is
basically permanently restarting them. To only way to stop this is
podman stop. However podman stop does not do anything when the
container is already in a not running state. While this makes sense we
should still mark the container as explicitly stopped by the user.

Together with the change in shouldRestart() which now checks for
StoppedByUser this makes sure the cleanup process is not going to start
it back up again.

A simple reproducer is:
```
podman run --restart=always --name test -d alpine true
podman stop test
```
then check if the container is still running, the behavior is very
flaky, it took me like 20 podman stop tries before I finally hit the
correct window were it was stopped permanently.
With this patch it worked on the first try.

Fixes #18259

[NO NEW TESTS NEEDED] This is super flaky and hard to correctly test
in CI. MY ginkgo v2 work seems to trigger this in play kube tests so
that should catch at least some regressions. Also this may be something
that should be tested at podman test days by users (#17912).

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-23 16:43:28 +02:00
OpenShift Merge Robot
38fd33bc20
Merge pull request #18654 from openshift-cherrypick-robot/cherry-pick-18542-to-v4.5
[v4.5] Do not include image annotations when building spec
2023-05-23 02:32:36 -04:00
Matt Heon
0f18a0144a Do not include image annotations when building spec
These annotations can have security implications - crun, for
example, allows rootless containers to preserve the user's groups
through an annotation. We absolutely should not include
annotations from an untrusted image off the internet by default.

We may consider whitelisting some annotations (e.g. the legacy
WASM annotations), but given that there is now a more explicit
way of specifying an image uses the WASM runtime in the OCI image
spec, I'm just tearing this out entirely for now.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-05-22 17:41:19 +00:00
OpenShift Merge Robot
c926b12c54
Merge pull request #18475 from edsantiago/cherrypick_18169
[v4.5] system tests: fix race in kube-play read-only
2023-05-05 04:18:12 -04:00
Ed Santiago
bc2f0115da [v4.5] system tests: fix race in kube-play read-only
Use --restart=no on all created containers. Without this, all
containers spin forever and it's impossible to get a
reliable exit status.

As a side effort, clean up tests, make more robust and maintainable.

This is a cherrypick of #18169 onto v4.5, because the flake is
triggering often in CI. The cherrypick applied cleanly.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-04 19:36:28 -06:00
OpenShift Merge Robot
2931e578fd
Merge pull request #18432 from openshift-cherrypick-robot/cherry-pick-18345-to-v4.5
[v4.5] api: fix parsing filters
2023-05-03 04:59:22 -04:00
Valentin Rothberg
696c2d40d2 api: fix parsing filters
Podman and Docker clients split the filter map slightly different, so
account for that when parsing the filters in the image-listing endpoint.

Fixes: #18092
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-03 06:58:47 +00:00
OpenShift Merge Robot
5d1f5d79ac
Merge pull request #18378 from openshift-cherrypick-robot/cherry-pick-18362-to-v4.5
[v4.5] Support systemd optional prefix '-' for devices.
2023-04-27 13:06:09 -04:00
Daniel J Walsh
1fa2eb53b6 Support systemd optional prefix '-' for devices.
Systemd supports unit files with a prefix '-' which
tells the system to check if the content exists before
using it. This would allow the QM project to specify
AddDevice=-/dev/kvm, which would add the /dev/kvm device
to the container iff it exists on the host.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-27 14:49:06 +00:00
OpenShift Merge Robot
6cd189b8db
Merge pull request #18256 from openshift-cherrypick-robot/cherry-pick-18145-to-v4.5
[v4.5] *: migrate image registry to registry.k8s.io
2023-04-18 12:05:09 -04:00
OpenShift Merge Robot
6a56c6fdf5
Merge pull request #18251 from openshift-cherrypick-robot/cherry-pick-18238-to-v4.5
[v4.5] Makefile: include `release-artifacts` target
2023-04-18 11:02:03 -04:00
Sohan Kunkerkar
74634a46cc *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-04-18 14:07:08 +00:00
Lokesh Mandvekar
0fb11cccda Makefile: include release-artifacts target
The current release artifacts generation process is still fairly manual
with a bunch of steps. This commit bundles them all into a single
convenient Makefile target.

The `clean-binaries` target ends up removing `bin/`. So, the artifact
dir has been changed to `release/` instead of the current `bin/` to
avoid breaking other Makefile targets.

Related: https://github.com/containers/podman/issues/18215

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-18 12:48:47 +00:00
OpenShift Merge Robot
ab25e76c20
Merge pull request #18203 from lsm5/v4.5-packit-backport
[v4.5 backport] [CI:BUILD] Packit: Initial Enablement
2023-04-15 13:09:37 -04:00
Lokesh Mandvekar
4d2cf293e0
[CI:BUILD] Packit: Initial Enablement
This commit adds Packit configuration files which will trigger rpm
builds on copr:`rhcontainerbot/packit-builds` on every PR as well as on
copr:`rhcontainerbot/qm` on every commit to v4.5 branch.

This commit will ensure main branch is always buildable on all supported
Fedora and CentOS Stream versions for aarch64 and x86_64.
TODO: enable build checks for s390x and ppc64le while ensuring they
don't take too long to build.

The packit builds reuse `podman.spec.rpkg` present upstream and are
thus independent of Fedora / CentOS dist-git.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-14 16:07:02 -04:00
OpenShift Merge Robot
e6055de952
Merge pull request #18200 from lsm5/v4.5.0-release
v4.5.0 release
2023-04-14 11:07:44 -04:00
Lokesh Mandvekar
da927a75c7
Bump to v4.5.1-dev
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-14 09:28:36 -04:00
Lokesh Mandvekar
75e3c12579
Release v4.5.0
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-14 09:28:20 -04:00
Lokesh Mandvekar
32a6892b6b
[CI:DOCS] Final release notes for v4.5.0
Co-authored-by: Ashley Cui <ashleycui16@gmail.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-04-14 09:27:46 -04:00
OpenShift Merge Robot
8bef583c60
Merge pull request #18195 from openshift-cherrypick-robot/cherry-pick-18178-to-v4.5
[v4.5] Quadlet - do not set log-driver by default
2023-04-14 08:39:42 -04:00
Ygal Blum
5de2a13e09 Quadlet - do not set log-driver by default
Update e2e tests not to expect the flag
System tests - explicitly set the log driver to be able to parse the output

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-04-14 08:58:56 +00:00
OpenShift Merge Robot
091706e3fe
Merge pull request #18191 from openshift-cherrypick-robot/cherry-pick-18136-to-v4.5
[v4.5] Return title fields as a list
2023-04-13 17:13:26 -04:00
Daniel J Walsh
c5e704c820 Return title fields as a list
Podman is attempting to split the headers returned by the ps
command into a list of headers. Problem is that some headers
are multi-word, and headers are not guaranteed to be split via
a tab. This PR splits the headers bases on white space, and for
the select group of CAPS headers which are multi-word, combines
them back together.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-13 19:33:35 +00:00
OpenShift Merge Robot
5a83f55d27
Merge pull request #18148 from mheon/bump_450_rc2
Bump to v4.5.0-RC2
2023-04-11 15:54:09 -04:00
Matthew Heon
bf6f58b028 Bump to v4.5.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-04-11 14:16:23 -04:00
Matthew Heon
f3c3658874 Bump to v4.5.0-RC2
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-04-11 14:16:06 -04:00
Matthew Heon
15c3025331 Final release notes for v4.5.0-RC2
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-04-11 14:15:39 -04:00
OpenShift Merge Robot
3a47342a6a
Merge pull request #18002 from Luap99/netavark-plugin
add netavark plugin support
2023-04-11 13:37:43 -04:00
OpenShift Merge Robot
cf3374e2a8
Merge pull request #18140 from umohnani8/deployments
Read kube_generate_type from containers.conf
2023-04-11 12:57:01 -04:00
OpenShift Merge Robot
8c4838f6b4
Merge pull request #18083 from Luap99/pause-single-process
rootless: make sure we only use a single pause process
2023-04-11 11:05:39 -04:00
Paul Holzinger
af7c258117
test/e2e: remove unnecessary SkipIfNetavark() calls
DHCP should be support with netavark now, the dns tests should just
work as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:43 +02:00
Paul Holzinger
80652cacfc
test/e2e: deduplicated network test
This test was added twice once for CNI and netavark, just write it once
there is no need to do this weird skip thing.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:42 +02:00
Paul Holzinger
b526839a4e
docs: update podman-network-create.1
- add information about netavark plugins
- add missing arguments to options the require an arg
- document that container dns is only supported with bridge

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:42 +02:00
Paul Holzinger
ed99a979ce
network create: add --interface-name
Allow users to customize the network_interface option is the network
config. For bridge this allows users to change the bridge name and for
maclvan it will be the same as `--opt parent=...`.
However the main reason for this option is to allow netavark plugins to
make use of it. I demoed the host-device plugin which makes use of this
as an example. While we could let users set them via --opt it is more
natural to just use the field which is designed for that purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:33 +02:00
OpenShift Merge Robot
915bebac94
Merge pull request #18144 from vrothberg/fix-18132
test/system/252-quadlet.bats: fix flake
2023-04-11 10:50:34 -04:00
OpenShift Merge Robot
887c46fad7
Merge pull request #18124 from containers/renovate/major-ci-vm-image
chore(deps): update dependency containers/automation_images to v20230405
2023-04-11 10:39:29 -04:00
Valentin Rothberg
676486a856 test/system/252-quadlet.bats: fix flake
Wait for the expected logs to appear in the journal before using
`journalctl`.  #18132 is likely flaking because `journalctl` does
not yet see the container's logs.

Also force the test to use the `passthrough` log driver to make sure
`podman logs` continues being tests.

Fixes: #18132
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-11 15:31:40 +02:00
Urvashi Mohnani
1bf5bdc689 Read kube_generate_type from containers.conf
Use the kube_generate_type from the containers.conf as
the default value for the --type flag for kube generate.
Override the default when userexplicitly sets the --type
flag.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-11 09:15:05 -04:00
OpenShift Merge Robot
6f2a61a156
Merge pull request #18101 from mheon/release_notes_450_pt2
[CI:DOCS] Add remaining release notes for v4.5.0-RC2
2023-04-11 08:51:56 -04:00
Ed Santiago
11ac0d03e3 Debian setup: workaround for runc /dev/char/10:200 bug
Debian system tests failing due to unwanted warning:

   skipping device /dev/char/10:200 for systemd:
      stat /sys/dev/char/10:200: no such file or directory

Let's see if modprobing tun will eliminate the warning.
Add loud comments requesting removal once runc bug is fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-11 06:34:43 -06:00
Paul Holzinger
38c217a0bf
pkg/rootless: use catatonit from /usr/libexec/podman
The path was missing a slash between the libexec path and the binary
name. This was never noticed because the code already falls back to a
builtt-in pause process.

Fixes: 71f96c2e6f ("rootless: define LIBEXECPODMAN")

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 11:00:07 +02:00
Paul Holzinger
bab95de9a2
rootless: make sure we only use a single pause process
Currently --tmpdir changes the location of the pause.pid file. this
causes issues because the c code in pkg/rootless does not know about
that. I tried to fix this[1] by fixing the c code to not use the
shortcut. While this fix worked it will result in many pause processes
leaking in the integrration tests.

Commit ab88632 added this behavior but following the disccusion it was
never the intention that we end up having more than one pause process.
The issues that was trying to fix was caused by somthing else AFAICT,
the main problem seems to be that the pause.pid file parent directory
may not be created when we try to create the pid file so it failed with
ENOENT. This patch fixes it by creating this directory always and revert
the change to no longer depend on the tmpdir value.

With this commit we now always use XDG_RUNTIME_DIR/libpod/tmp/pause.pid
for all podman processes. This allows the c shortcut to work reliably
and should therefore improve perfomance over my other approach.

A system test is added to ensure we see the right behavior and that
podman system migrate actually stops the pause process. Thanks to Ed
Santiago for the improved test to make it work for both `catatonit` and
`podman pause`.

This should fix the issues with namespace missmatches that we can see in
CI as flakes.

[1] https://github.com/containers/podman/pull/18057

Fixes #18057

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 10:57:46 +02:00
OpenShift Merge Robot
4857c65d3e
Merge pull request #18035 from n1hility/flush-config
Update podman to use atomic container and machine config updates
2023-04-11 02:53:42 -04:00
OpenShift Merge Robot
820976a91e
Merge pull request #18138 from cevich/use_gha_versions
[CI:DOCS] GHA: Use version instead of SHA for actions
2023-04-10 16:23:07 -04:00
Jason T. Greene
3b2b1441ec Use atomic config writing strategy for podman machine config files
Windows: Flush machine config writes before renaming
Windows: Previously this code was changed to improve atomicity by changing
the persitence approach to a two-step process (write + rename).
However, the first-step write operation was not fully flushed,
leading to the possibility of incomplete writes.

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-04-10 14:57:49 -05:00
Matt Heon
67307603b4 Add remaining release notes for v4.5.0-RC2
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-04-10 15:22:42 -04:00
Chris Evich
d53871cf12
GHA: Use version instead of SHA for actions
It's nearly impossible for humans to tell semantic-version differences
by looking at a commit sha.  Since all the actions in question come from
github, there's little security/safety benefit to using SHAs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-04-10 14:45:36 -04:00
renovate[bot]
25bc7d161e
chore(deps): update dependency containers/automation_images to v20230405
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-10 17:35:57 +00:00
Daniel J Walsh
1f2775cbdc
Merge pull request #18130 from flouthoc/bump-deps
vendor: bump `containers/(storage, buildah, image, common)`
2023-04-10 13:33:44 -04:00
Daniel J Walsh
0a89a22c71
Merge pull request #18105 from rhatdan/codespell
Fix up codespell errors
2023-04-10 13:33:04 -04:00