19308 Commits

Author SHA1 Message Date
34c258b419 libpod: fix timezone handling
The current way of bind mounting the host timezone file has problems.
Because /etc/localtime in the image may exist and is a symlink under
/usr/share/zoneinfo it will overwrite the targetfile. That confuses
timezone parses especially java where this approach does not work at
all. So we end up with an link which does not reflect the actual truth.

The better way is to just change the symlink in the image like it is
done on the host. However because not all images ship tzdata we cannot
rely on that either. So now we do both, when tzdata is installed then
use the symlink and if not we keep the current way of copying the host
timezone file in the container to /etc/localtime.

Also note that we need to rebuild the systemd image to include tzdata in
order to test this as our images do not contain the tzdata by default.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2149876

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-01 11:04:13 +02:00
22424eb5d7 fix(deps): update github.com/godbus/dbus/v5 digest to 7623695
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-01 03:15:04 +00:00
7987d2ee0a fix(deps): update module golang.org/x/tools to v0.9.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-31 23:41:38 +00:00
249f0463eb Merge pull request #18721 from Cydox/fix-ulimit-pr
fix ulimit issue
2023-05-31 16:53:49 -04:00
5543de25d5 Merge pull request #18747 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.9.6
2023-05-31 12:53:51 -04:00
4173f942f1 test/system: quadlet use correct systemd restart policy
Systemd doesn't support `never` and logs a warning, systemd uses no as
default so we do not have to specify it at all.

Check systemd.service(5) for the systemd docs.

Fixes #18743

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-31 18:50:16 +02:00
af5b1d6e80 Merge pull request #18643 from eriksjolund/use-imperative-form
man pages and command help: unify verb forms
2023-05-31 11:16:23 -04:00
b9bdfea8e7 Merge pull request #18752 from edsantiago/log_k8s_race
systests: minimize race-condition window
2023-05-31 10:23:30 -04:00
0d7702bd93 Merge pull request #18744 from edsantiago/quadlet_race
systests: fix race in quadlet tests
2023-05-31 10:20:52 -04:00
19d39091b3 Merge pull request #18755 from edsantiago/dont_bg_run_podman
systests: fix improper backgrounding of run_podman
2023-05-31 10:13:08 -04:00
45e93014c5 Merge pull request #18730 from tmds/authfilepath_non_linux
[CI:DOCS] authfile.md: add default path of file for Windows/macOS.
2023-05-31 09:01:52 -04:00
0372bf4bdd systests: minimize race-condition window
Reduce sleep-loop time in logs test, from 1s to 0.1s,
to make 'podman stop' take effect more quickly. With 1s,
and testing with 1s resolution, we get flakes.

Fixes: #17826

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-31 06:38:17 -06:00
1a34e1f855 systests: fix improper backgrounding of run_podman
run_podman cannot be backgrounded. Use $PODMAN instead.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-31 06:20:35 -06:00
b7d4da671b Merge pull request #18734 from edsantiago/image-rm-race
e2e: make BuildImage parallel-safe
2023-05-31 05:33:36 -04:00
f097728891 set max ulimits for rootless on each start
Signed-off-by: Jan Hendrik Farr <github@jfarr.cc>
2023-05-31 09:20:31 +00:00
5c7d50f08c Fix: display online_cpus in compat REST API
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2023-05-31 07:41:30 +03:00
bd62119f36 fix(deps): update module github.com/onsi/ginkgo/v2 to v2.9.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-31 03:09:02 +00:00
72d4cede29 systests: fix race in quadlet tests
The new exit-code propagation test is racy: 'podman wait' can
fail if the service container has already been cleaned up by
systemd.

Solution: run the inspect and wait tests opportunistically, i.e.,
only if those commands succeed. If they fail, confirm that they
fail with ENOSUCHCONTAINER. This may silently lose us some
coverage ... but none of it is important. The important
test, systemctl final status, remains.

Also, as drive-bys:
 - add a FIXME comment documenting another race condition
   that I'm not bothering to fix right now

 - give distinct names to unit files, for readability in
   test failures

Fixes: #18732

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-30 13:38:51 -06:00
c9c5cb2224 Merge pull request #18741 from containers/renovate/github.com-burntsushi-toml-1.x
fix(deps): update module github.com/burntsushi/toml to v1.3.0
2023-05-30 15:31:52 -04:00
710315d33c Merge pull request #18577 from rhatdan/build
Support podman --remote when Containerfile is not in context directory
2023-05-30 13:53:02 -04:00
f48fa11131 fix(deps): update module github.com/burntsushi/toml to v1.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-30 16:13:20 +00:00
fa61bb2594 Merge pull request #18736 from Luap99/completion-panic
completion: fix panic in simplePathJoinUnix()
2023-05-30 12:11:59 -04:00
77bd041a96 Merge pull request #18731 from containers/renovate/github.com-stretchr-testify-1.x
Update module github.com/stretchr/testify to v1.8.4
2023-05-30 11:03:18 -04:00
88e78456db e2e: make BuildImage parallel-safe
"image rm concurrent" test is still failing, even after #18664:

    Error: no contents in "/tmp/podman_test967723851/Dockerfile"

Probable cause: the images are built in parallel, and p.BuildImage()
writes one single Dockerfile. (This almost certainly renders the
test less effective than intended, since the generated images
might end up being identical).

Solution: write and use a uniquely-named Dockerfile

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-30 08:16:26 -06:00
370e1132ce completion: fix panic in simplePathJoinUnix()
When we do path completion in images a user could try to complete a
simple relative path, e.g. podman run $IMAGE e... should complete to etc
if this path exists in the image. Right now we panic in this case as the
current check didn't account for an empty string in simplePathJoinUnix().
In such a case return the path directly because we can not alter what
the user typed on the cli and must return a path without slash as well
in order for the shell to suggest the completion.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2209809

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-30 16:09:19 +02:00
0ab95af371 Merge pull request #18729 from containers/renovate/github.com-rootless-containers-rootlesskit-1.x
Update module github.com/rootless-containers/rootlesskit to v1.1.1
2023-05-30 08:36:43 -04:00
46456f5f15 Update module github.com/stretchr/testify to v1.8.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-30 11:05:50 +00:00
585d715bb9 authfile.md: add default path of file for Windows/macOS.
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2023-05-30 11:16:34 +02:00
01012a0807 Update module github.com/rootless-containers/rootlesskit to v1.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-30 08:19:36 +00:00
8b2adb836f Merge pull request #18728 from sstosh/typo-hack-registry
hack: fix typo in hack/podman-registry
2023-05-30 04:17:57 -04:00
e3240c2fb4 hack: fix typo in hack/podman-registry
hack/podman-registry --help option does not exist.
We need to use -h option when we want to see the usage message.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-05-30 11:47:10 +09:00
de92db0c81 man pages and command help: clean up descriptions
Short description in man pages:
* Use imperative form

Command help (cobra.Command.Short):
* Capitalize first letter
* Use imperative form
* Remove ending full stop when the short description
  only contains one sentence without any commas

Command help (cobra.Command.Long):
* Capitalize first letter unless the sentence starts
  with a command "podman command ..."
* Use imperative form when the long description is
  identical or almost identical to the short description.
  This modification was only done in a few places.

Command tables:
* Use imperative form in the "Description" column

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-28 18:57:43 +02:00
e7dc5074a3 Merge pull request #18681 from Luap99/reexec-signals
pkg/rootless: correctly handle proxy signals on reexec
2023-05-27 17:19:58 -04:00
ed1c176f63 Merge pull request #18707 from lsm5/bump-gvisor-and-fix-packit
RPM: bump gvisor-tap-vsock subpackage and fix packit scripts
2023-05-27 17:04:09 -04:00
71c65c27d3 Merge pull request #18678 from edsantiago/gomd2man-workaround
Man pages: fix broken tables
2023-05-27 16:40:52 -04:00
e6bfc81a8f RPM: bump gvisor-tap-vsock subpackage and fix packit scripts
gvisor-tap-vsock:
- bump to v0.6.1
- installs /usr/libexecdir/podman/gvforwarder

packit:
- fix pre-sync action in propose-downstream
Ref: https://dashboard.packit.dev/results/propose-downstream/2581

cleanup:
- remove `contrib/spec/python-podman.spec.in`. No longer needed.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-05-26 14:32:52 -04:00
dfba6ddd4c Man pages: fix broken tables
Work around a go-md2man bug, and add a check script to make sure
this doesn't hit us again.

Background: go-md2man can't deal with a left-hand column > 31 chars.
It produces man pages that look like:

    | Something With >31 Character |                |
    |                              | ..description  |

(should be all on one row). It also has trouble when the vertical
bars are misaligned: it completely removes the right-hand side.

There's almost certainly a better solution: fix go-md2man, or
use a different conversion tool, or maybe even pre/postprocess.
But this is a quick interim solution.

Sorry for the perl. This could be done in bash/sed/awk/grep,
but not with any sort of sane error messages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-26 06:08:14 -06:00
1210efc44d Merge pull request #18689 from 89luca89/fix/filter_flags
fix: move filter flags from StringSliceVar to StringArrayVar
2023-05-26 07:57:51 -04:00
e7ef259cb6 Merge pull request #18671 from vrothberg/RUN-1776
kube play: add exit-code propagation
2023-05-26 04:57:24 -04:00
5b2d963c44 test/e2e: add regression testing for comma-containing labels
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2023-05-25 22:56:27 +02:00
047a4bc830 fix: volume create filters
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2023-05-25 21:34:53 +02:00
0357881075 Merge pull request #18687 from lsm5/packit-downstream-followup
[CI:BUILD] Packit: set propose-downstream action type to pre-sync
2023-05-25 12:38:46 -04:00
0be9887afc fix: move filter flags from StringSliceVar to StringArrayVar
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2023-05-25 16:53:14 +02:00
6bc52c9c5e pkg/rootless: correctly handle proxy signals on reexec
There are quite a lot of places in podman were we have some signal
handlers, most notably libpod/shutdown/handler.go.

However when we rexec we do not want any of that and just send all
signals we get down to the child obviously. So before we install our
signal handler we must first reset all others with signal.Reset().

Also while at it fix a problem were the joinUserAndMountNS() code path
would not forward signals at all. This code path is used when you have
running containers but the pause process was killed.

Fixes #16091
Given that signal handlers run in different goroutines parallel it would
explain why it flakes sometimes in CI. However to my understanding this
flake can only happen when the pause process is dead before we run the
podman command. So the question still is what kills the pause process?

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-25 16:48:15 +02:00
85b4c896bd [CI:BUILD] Packit: set propose-downstream action type to pre-sync
Also address review concerns in pr#18675.

[NO NEW TESTS NEEDED]

Co-authored-by: Chris Evich <cevich@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-05-25 09:26:35 -04:00
8f94a4775a [CI:DOCS] fix Quadlet man page rendering
Fixes: https://github.com/containers/podman/pull/18671#pullrequestreview-1442193542
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
29f7c494ee Quadlet: kube: use ExecStopPost
Use ExecStopPost instead of ExecStop to make sure containers, pods, etc.
are all cleaned up even in case of an error.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
6487d9c11a Quadlet: kube: add ExitCodePropagation field
Add a new field `ExitCodePropagation` field to allow for configuring the
newly added functionality of controlling how the main PID of a kube
service exits.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
08b0d93ea3 kube play: exit-code propagation
Implement means for reflecting failed containers (i.e., those having
exited non-zero) to better integrate `kube play` with systemd.  The
idea is to have the main PID of `kube play` exit non-zero in a
configurable way such that systemd's restart policies can kick in.

When using the default sdnotify-notify policy, the service container
acts as the main PID to further reduce the resource footprint.  In that
case, before stopping the service container, Podman will lookup the exit
codes of all non-infra containers.  The service will then behave
according to the following three exit-code policies:

 - `none`: exit 0 and ignore containers (default)
 - `any`: exit non-zero if _any_ container did
 - `all`: exit non-zero if _all_ containers did

The upper values can be passed via a hidden `kube play
--service-exit-code-propagation` flag which can be used by tests and
later on by Quadlet.

In case Podman acts as the main PID (i.e., when at least one container
runs with an sdnotify-policy other than "ignore"), Podman will continue
to wait for the service container to exit and reflect its exit code.

Note that this commit also fixes a long-standing annoyance of the
service container exiting non-zero.  The underlying issue was that the
service container had been stopped with SIGKILL instead of SIGTERM and
hence exited non-zero.  Fixing that was a prerequisite for the exit-code
propagation to work but also improves the integration of `kube play`
with systemd and hence Quadlet with systemd.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:34 +02:00
6dbc138339 prune exit codes only when container doesn't exist
Make sure to prune container exit codes only when the associated
container does not exist anymore.  This is needed when checking if any
container in kube-play exited non-zero and a building block for the
below linked Jira card.

[NO NEW TESTS NEEDED] - there are no unit tests for exit code pruning.

Jira: https://issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 13:14:27 +02:00