19179 Commits

Author SHA1 Message Date
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
dd753c6f9a Merge pull request #18795 from rhatdan/quadlet
Add support for SecurityLabelNested flag in quadlet
2023-06-07 07:16:09 -04:00
15fc6ec729 Merge pull request #18815 from containers/renovate/github.com-onsi-gomega-1.x
fix(deps): update module github.com/onsi/gomega to v1.27.8
2023-06-07 05:58:12 -04:00
82111af49a Merge pull request #18801 from containers/renovate/github.com-burntsushi-toml-1.x
fix(deps): update module github.com/burntsushi/toml to v1.3.1
2023-06-07 04:53:16 -04:00
7bdbbd0cec fix(deps): update module github.com/onsi/gomega to v1.27.8
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 07:49:45 +00:00
c7a8d29f12 refactor: improve get ssh path duplicate code
Signed-off-by: Black-Hole1 <bh@bugs.cc>
2023-06-07 09:03:35 +08:00
137c8ef4d5 logformatter: better recognition of ginkgo test names
Ginkgo test names can have more than two levels: there can be
a nested series of Describes() before the final It(). (e.g.,
quadlet_test.go). Handle that.

Before: we just assumed that the third-or-maybe-fourth line
after a "-----" divider was the test name.

Now: examine every line after the "-----" divider, until the
first empty line. Lines with /path/to/source/file are ignored,
lines with text strings are assembled together to make anchors.
This is still imperfect but it's much better than before.

SPECIAL NOTE: in order to allow linking to timing results
in the AfterSuite, I've changed the test name from Leaf to Full.
This will now be a much longer string, and hence much less
readable, but I'm inclined to think it's more correct. Please
review carefully and lmk if I should revert.

Finally, as an unrelated add-on, add links (at top) to original
log, journal, and (if applicable) podman-remote server logs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-06 14:32:15 -06:00
944673c883 Address review feedback and add manpage notes
The inspect format for `.LockNumber` needed to be documented.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-06 11:04:59 -04:00
8e3ecc8936 Merge pull request #18772 from esendjer/main
fix ignition config creation (propagation of proxy settings)
2023-06-06 10:45:55 -04:00
3b79f241b1 Add support for SecurityLabelNested flag in quadlet
This flag will allow us to run nested containers within
a quadlet service.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-06 10:30:48 -04:00
6f38a72c2a Merge pull request #18764 from containers/renovate/github.com-crc-org-vfkit-digest
fix(deps): update github.com/crc-org/vfkit digest to 3d57f09
2023-06-06 06:46:23 -04:00
a1c1d8d0a7 fix(deps): update module github.com/burntsushi/toml to v1.3.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-06 10:45:12 +00:00
953eaffbf8 Merge pull request #18766 from containers/renovate/github.com-mattn-go-sqlite3-1.x
fix(deps): update module github.com/mattn/go-sqlite3 to v1.14.17
2023-06-06 06:43:46 -04:00
4fda7936c5 system locks now reports held locks
To debug a deadlock, we really want to know what lock is actually
locked, so we can figure out what is using that lock. This PR
adds support for this, using trylock to check if every lock on
the system is free or in use. Will really need to be run a few
times in quick succession to verify that it's not a transient
lock and it's actually stuck, but that's not really a big deal.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-05 19:34:36 -04:00
92309d917b fix(deps): update module github.com/mattn/go-sqlite3 to v1.14.17
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 21:17:26 +00:00
f84a2ff9f7 Merge pull request #18725 from fatelei/docs
[CI:DOCS] feat: add insecure registry troubleshooting solution
2023-06-05 16:03:18 -04:00
0948c078c2 Add a new hidden command, podman system locks
This is a general debug command that identifies any lock
conflicts that could lead to a deadlock. It's only intended for
Libpod developers (while it does tell you if you need to run
`podman system renumber`, you should never have to do that
anyways, and the next commit will include a lot more technical
info in the output that no one except a Libpod dev will want).
Hence, hidden command, and only implemented for the local driver
(recommend just running it by SSHing into a `podman machine` VM
in the unlikely case it's needed by remote Podman).

These conflicts should normally never happen, but having a
command like this is useful for debugging deadlock conditions
when they do occur.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-05 14:47:12 -04:00
eec15a108a Merge pull request #18657 from arizvisa/GH-18120
Added the "--out" parameter and fixed an issue with "--noout" which prevented stdout from being written to.
2023-06-05 14:34:21 -04:00
1013696ad2 Add number of free locks to podman info
This is a nice quality-of-life change that should help to debug
situations where someone runs out of locks (usually when a bunch
of unused volumes accumulate).

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-05 14:00:40 -04:00
3b39eb1333 Include lock number in pod/container/volume inspect
Being able to easily identify what lock has been allocated to a
given Libpod object is only somewhat useful for debugging lock
issues, but it's trivial to expose and I don't see any harm in
doing so.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-05 12:28:50 -04:00
d669d948a3 Merge pull request #18788 from ygalblum/quadlet-pull
Quadlet - add support for Pull key in .container
2023-06-05 11:27:21 -04:00
1ce53677aa fix ignition config creation
* the sequence of Ignition config creation was broken,
so that the part responsible for propagation of proxy
settings has been out of the final ignConfig

* e2e test for proxy settings propagation

Signed-off-by: esendjer <esendjer@gmail.com>
2023-06-05 18:03:14 +03:00
4584350f6e Makefile binaries target adopted for Mac and Win
Signed-off-by: esendjer <esendjer@gmail.com>
2023-06-05 17:59:47 +03:00
e143a0ff8e Merge pull request #18774 from dgibson/bad-default-protocol
pasta: Correct handling of unknown protocols
2023-06-05 10:40:00 -04:00
18eb74fd4e Merge pull request #18789 from edsantiago/logformatter_fix_h2
logformatter: proper status color for failed tests
2023-06-05 10:32:16 -04:00
99a8e9450f Merge pull request #18733 from umohnani8/ulimit
Add default ulimit test for gen kube
2023-06-05 08:59:16 -04:00
e93b1f9974 fix(deps): update github.com/crc-org/vfkit digest to 3d57f09
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 12:53:57 +00:00
c51c6675ee logformatter: proper status color for failed tests
Fix an oops in my ginkgo-v2 handling: subtest-status was
getting re-reset back to "passed", resulting in incorrect
and misleading green titles on failed tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-05 05:59:11 -06:00
cf9bc25bbc pasta: Test handling of unknown protocols
Test that pasta generates a sensible error message if asked to forward a
protocol it doesn't understand.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-06-05 19:32:54 +10:00
6eb8157602 Merge pull request #18787 from containers/renovate/github.com-sirupsen-logrus-1.x
fix(deps): update module github.com/sirupsen/logrus to v1.9.3
2023-06-05 05:01:32 -04:00
b2c0006706 pasta: Correct handling of unknown protocols
setupPasta() has logic to handle forwarding of TCP or UDP ports.  It has
what looks like logic to give an error if trying to forward ports of any
other protocol.  However, there's a straightforward error in this that it
will in fact only give the error if you try to use a protocol called
"default".  Other unknown protocols will fall through and result in a
nonsensical pasta command line which will almost certainly cause a cryptic
error later on.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-06-05 12:21:08 +10:00
6611735aeb Quadlet - add support for Pull key in .container
Update code, doc and test
Remove doc comment on pull policy

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-06-04 09:06:30 +03:00
5b629e9c4a fix(deps): update module github.com/sirupsen/logrus to v1.9.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-03 22:41:38 +00:00
aee7a3c16a Merge pull request #18769 from edsantiago/getport_rewrite
e2e: GetPort(): safer allocation of random ports
2023-06-02 15:39:43 -04:00