19162 Commits

Author SHA1 Message Date
d0e2428fb6 fix(deps): update module golang.org/x/term to v0.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-12 22:32:03 +00:00
3cae574ab2 Merge pull request #18507 from mheon/fix_rm_depends
Fix `podman rm -fa` with dependencies
2023-06-12 13:27:34 -04:00
1e1efd82a4 Merge pull request #18857 from Luap99/criu-version-error
criu: return error when checking for min version
2023-06-12 12:02:45 -04:00
77d2ae90c6 Merge pull request #18838 from rhatdan/workdir
Add WorkingDir support to quadlet
2023-06-12 09:56:06 -04:00
ab502fc5c4 criu: return error when checking for min version
There is weird issue #18856 which causes the version check to fail.
Return the underlying error in these cases so we can see it and debug
it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-12 15:29:21 +02:00
e02fa23680 Merge pull request #18854 from vrothberg/rm-comment
250-systemd.bats: remove outdated comment
2023-06-12 08:51:25 -04:00
7286881460 Merge pull request #18853 from Luap99/desktop-issue
[SKIP CI] github: add issue type as link to podman-desktop
2023-06-12 08:42:19 -04:00
469aca05e8 Merge pull request #18850 from francisbergin/api-doc-fix
Fix system service manpage name in API Documentation
2023-06-12 08:39:05 -04:00
c83589a852 Merge pull request #18835 from Luap99/update-container-deps
update c/{common,image,storage} to latest
2023-06-12 08:36:07 -04:00
decbab9223 Merge pull request #18829 from containers/renovate/requests-mock-1.x
chore(deps): update dependency requests-mock to ~=1.11.0
2023-06-12 08:29:49 -04:00
16092930c7 Update docs/source/markdown/podman-systemd.unit.5.md
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-12 08:07:42 -04:00
faa2689dcd 250-systemd.bats: remove outdated comment
Remove an outdated comment on the absence of exit-code propagation when
running K8s workloads in systemd.  The `podman-kube@` systemd template
is using default restart policy of the system.  The exit-code
propagation is tested in other tests, so we can keep the logic as is.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-12 13:18:50 +02:00
0714321de9 github: add issue type as link to podman-desktop
I see a lot of podman-desktop bug reports on the podman repo. This is
not the correct place to file these reports but many users seem to be
unaware of that. This is an attempt to point them in the right
direction. It should show up as extra entry in the issue type
selection so hopefully users while read that and follow the link in the
desktop repository.

See this link for the github docs about the configuration:
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-12 11:39:22 +02:00
a66bab3403 Add WorkingDir support to quadlet
One feature needed for podmansh is the ability to set the default
homedir to be the workingdir when you login.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-12 05:15:44 -04:00
ebf7474747 rootlessport: exclude storage drivers via build tags
Because of a c/storage change[1] all we get a lot of new dependencies in
rootlessport despite not using them. Add build tags to exclude storage
drivers to make the binary smaller until it get addressed in c/storage.

This saves about 800 MB but the bloat due that change is still causing
us to gain over 2 MB. This is not ideal but we should get vendoring
going and not wait any longer.

[1] https://github.com/containers/storage/pull/1618

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-12 10:51:30 +02:00
8bf168cc13 Add ability to set static routes
add routes using the --route flag.
the no_default_route option in --opt prevents a default route from
getting added automatically.

Signed-off-by: Jan Hendrik Farr <github@jfarr.cc>
2023-06-12 10:31:59 +02:00
68183b07d6 test/upgrade: correctly share mounts between host and container
A c/storage PR[1] chnage the behavior to correctly report umount errors.
This is causing problem in the updgrade tests. The problem is that a
cotnainer is mounted inside another container and then unmounted on the
host. Therefore both operations happen in different mount namespaces.
this is expcted but we want to share the mounts between them. This is
the default but c/stroage make the root private by default thus the
mounts were not shared. To fix this use the `skip_mount_home` storage
option so the mount is kept shared.

[1] https://github.com/containers/storage/pull/1607

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-12 10:31:59 +02:00
444f19cb2a Update common, image, and storage deps
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-12 10:31:58 +02:00
32d96f40c3 Merge pull request #18849 from xtexChooser/xtex-fix-18848
fix(specgen): index out of range when unmask=[]
2023-06-12 03:44:56 -04:00
ec6b7dbd90 Fix system service manpage name in API Documentation
[NO NEW TESTS NEEDED]

Signed-off-by: Francis Bergin <francisbergin@hotmail.com>
2023-06-11 14:21:46 -04:00
d734fcbff2 style(specgen): omit nil check
len(nil) == 0

[NO NEW TESTS NEEDED]

Signed-off-by: xtex <xtexchooser@duck.com>
2023-06-11 10:00:27 +08:00
53834ef0dc fix(specgen): index out of range when unmask=[]
Fixes #18848

Signed-off-by: xtexChooser <xtexchooser@duck.com>
2023-06-11 08:58:35 +08:00
6856c7717d Merge pull request #18837 from andyedwardsibm/main
Makefile to force a shell when running command
2023-06-10 07:02:41 -04:00
71cae3159f Makefile to force a shell when running command
Address a build break on Ubuntu 20.04 in the Makefile whereby calling `command` fails

Signed-off-by: Andy Edwards <andy.edwards@uk.ibm.com>
2023-06-09 13:27:21 +01:00
6db512d9b9 Merge pull request #18822 from flouthoc/debian-use-overlay
cirrus,ci: default to `overlay` if using `vfs`
2023-06-09 06:46:03 -04:00
81079575f5 Merge pull request #18785 from LauKr/main
Quadlet: Add support for --sysctl
2023-06-09 04:21:48 -04:00
02432fc692 cirrus,ci: default to overlay for debian env
In debian environment we are hitting an edge-case where older buildah
version is not compatible with newer podman version because both of them
are using different storage driver.

I.e
* Podmand defaults to native `overlay`.
* Older buildah version defaults to `vfs`.

See discussions below for more details
* containers#18510 (comment)

Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
2023-06-09 10:43:58 +05:30
4d43e1b40d Merge pull request #18827 from dfr/freebsd-bash
Makefile: don't hard-code the path for bash
2023-06-08 17:25:24 -04:00
b37f74b732 Quadlet: Add support for --sysctl flag
The Sysctl=name=value entry can be used to set --sysctl=name=value
directly without the need to use PodmanArgs=--sysctl=name=value.

Signed-off-by: Laurenz Kruty <git@laurenzkruty.de>
2023-06-08 21:19:09 +02:00
44ec044c49 chore(deps): update dependency requests-mock to ~=1.11.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-08 17:01:24 +00:00
dc1ddad930 Merge pull request #18826 from containers/renovate/github.com-burntsushi-toml-1.x
fix(deps): update module github.com/burntsushi/toml to v1.3.2
2023-06-08 10:08:44 -04:00
2ebc9004f4 Ignore spurious warnings when killing containers
There are certain messages logged by OCI runtimes when killing a
container that has already stopped that we really do not care
about when stopping a container. Due to our architecture, there
are inherent races around stopping containers, and so we cannot
guarantee that *we* are the people to kill it - but that doesn't
matter because Podman only cares that the container has stopped,
not who delivered the fatal signal.

Unfortunately, the OCI runtimes don't understand this, and log
various warning messages when the `kill` command is invoked on a
container that was already dead. These cause our tests to fail,
as we now check for clean STDERR when running Podman. To work
around this, capture STDERR for the OCI runtime in a buffer only
for stopping containers, and go through and discard any of the
warnings we identified as spurious.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-08 09:19:47 -04:00
7832879bf5 Makefile: don't hard-code the path for bash
On FreeBSD, it usually lives in /usr/local/bin/bash. This uses the shell
'commmand' builtin to find the path which works in bash, dash and the
FreeBSD /bin/sh.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-06-08 14:02:38 +01:00
de4b383ef3 fix(deps): update module github.com/burntsushi/toml to v1.3.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-08 11:40:47 +00:00
471f952fd0 Merge pull request #18791 from edsantiago/registry_remember_podman_args
podman-registry: simpler, safer invocations
2023-06-08 07:39:37 -04:00
2b82303749 Merge pull request #18818 from cevich/fix_bad_cron_links
[CI:BUILD] GHA: Fix bad job-names & links in monitoring emails
2023-06-08 07:26:40 -04:00
a7271f9dd7 GHA: Fix bad job-names & links in monitoring emails
Due to a bad file-format design, if a cirrus-cron job happened to have a
name w/ spaces, the generated e-mail text would be broken.  For example:

```
Cron build 'VM' Failed: https://cirrus-ci.com/build/Image Maintenance
5630822628196352
```

Fix this by flipping the field-order in an intermediate file, so the
build ID comes first, then the job name.  This makes it much easier for
`read` to process, since all words will be stored into the final
variable (now the job name).

Also change all variables that reference this intermediate file such
that they continue to reflect the expected field order.  Update script
tests and add a new test to confirm expected file processing and output.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-06-07 15:22:17 -04:00
6a696cb8fd podman-registry: simpler, safer invocations
First: fix podman-registry script so it preserves the initial $PODMAN,
so all subsequent invocations of ps, logs, and stop will use the
same binary and arguments. Until now we've handled this by requiring
that our caller manage $PODMAN (and keep it the same), but that's
just wrong.

Next, simplify the golang interface: move the $PODMAN setting into
registry.go, instead of requiring e2e callers to set it. (This
could use some work: the local/remote conditional is icky).

IMPORTANT: To prevent registry.go from using the wrong podman binary,
the Start() call is gone. Only StartWithOptions() is valid now.

And, minor cleanup: comments, and add an actual error-message check

Reason for this PR is a recurring flake, #18355, whose multiple
failure modes I truly can't understand. I don't think this PR
is going to fix it, but this is still necessary work.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-07 12:16:18 -06:00
f1ecdca4b6 Ensure our mutexes handle recursive locking properly
We use shared-memory pthread mutexes to handle mutual exclusion
in Libpod. It turns out that these have configurable options for
how to handle a recursive lock (IE, a thread trying to lock a
lock that the same thread had previously locked). The mutex can
either deadlock, or allow the duplicate lock without deadlocking.
Default behavior is, helpfully, unspecified, so if not explicitly
set there is no clear indication of which of these behaviors will
be seen. Unfortunately, today is the first I learned of this, so
our initial implementation did *not* explicitly set our preferred
behavior.

This turns out to be a major problem with a language like Golang,
where multiple goroutines can (and often do) use the same OS
thread. So we can have two goroutines trying to stop the same
container, and if the no-deadlock mutex behavior is in use, both
threads will successfully acquire the lock because the C library,
not knowing about Go's lightweight threads, sees the same PID
trying to lock a mutex twice, and allows it without question.

It appears that, at least on Fedora/RHEL/Debian libc, the default
(unspecified) behavior of the locks is the non-deadlocking
version - so, effectively, our locks have been of questionable
utility within the same Podman process for the last four years.
This is somewhat concerning.

What's even more concerning is that the Golang-native sync.Mutex
that was also in use did nothing to prevent the duplicate locking
(I don't know if I like the implications of this).

Anyways, this resolves the major issue of our locks not working
correctly by explicitly setting the correct pthread mutex
behavior.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-07 14:09:12 -04:00
310082444c Fix an expected error message from pod removal
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-07 14:09:12 -04:00
a750cd9876 Fix a race removing multiple containers in the same pod
If the first container to get the pod lock is the infra container
it's going to want to remove the entire pod, which will also
remove every other container in the pod. Subsequent containers
will get the pod lock and try to access the pod, only to realize
it no longer exists - and that, actually, the container being
removed also no longer exists.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-07 14:09:12 -04:00
0e47465e4a Discard errors when a pod is already removed
This was causing some CI flakes. I'm pretty sure that the pods
being removed already isn't a bug, but just the result of another
container in the pod removing it first - so no reason not to
ignore the errors.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-07 14:09:12 -04:00
398e48a24a Change Inherit to use a pointer to a container
This fixes a lint issue, but I'm keeping it in its own commit so
it can be reverted independently if necessary; I don't know what
side effects this may have. I don't *think* there are any
issues, but I'm not sure why it wasn't a pointer in the first
place, so there may have been a reason.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-06-07 14:09:07 -04:00
c99d42b8e4 Merge pull request #18798 from edsantiago/fix_filters
filters: better handling of id=
2023-06-07 12:31:11 -04:00
384e937a6c Merge pull request #18816 from edsantiago/ginkgo_decorators
e2e: add ginkgo decorators to address flakes
2023-06-07 12:28:40 -04:00
b65ba90df3 e2e: add ginkgo decorators to address flakes
- trust_test: adding 'Ordered' seems to resolve a very common
  flake. I've tested this for dozens of CI runs, and haven't
  seen the flake recur (normally it fails every few runs).

- exec and search tests: add FlakeAttempts(3). This is a NOP
  under our current CI setup, in which we run ginkgo with
  a global --flake-attempts=3. I am submitting this as an
  optimistic step toward a no-flake-attempts world (#17967)

Fixes: #18358

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-07 07:10:25 -06:00
82caa100b1 Merge pull request #18804 from edsantiago/logformatter_handle_levels
logformatter: better recognition of test names
2023-06-07 08:23:58 -04:00
76f4571b71 Merge pull request #18796 from mheon/lock_debugging
Add support for lock debugging
2023-06-07 08:21:17 -04:00
377245d9be Merge pull request #18750 from BlackHole1/improve-ssh
refactor: improve get identity path duplicate code
2023-06-07 08:13:17 -04:00
992093ae91 filters: better handling of id=
For filter=id=XXX (containers, pods) and =ctr-ids=XXX (pods):

  if XXX is only hex characters, treat it as a PREFIX
  otherwise, treat it as a REGEX

Add tests. Update documentation. And fix an incorrect help message.

Fixes: #18471

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-07 05:29:06 -06:00