Commit Graph

16612 Commits

Author SHA1 Message Date
OpenShift Merge Robot 1e16668ecc
Merge pull request #15173 from carljmosca/main
[CI:DOCS] added docs for installing certificate authority
2022-09-16 16:58:48 +02:00
OpenShift Merge Robot 924079f8a1
Merge pull request #15755 from edsantiago/docs_for_formats
[CI:DOCS] man pages: document some --format options
2022-09-16 16:20:40 +02:00
OpenShift Merge Robot 740223c441
Merge pull request #15812 from sstosh/checkpoint-export-rawinput
remote: checkpoint --export prints a rawInput or an error on remote
2022-09-16 12:26:07 +02:00
OpenShift Merge Robot 4ba6ee3060
Merge pull request #15776 from cevich/no_ubuntu_unit
Cirrus: Only run unit-testing on Fedora.
2022-09-16 11:36:27 +02:00
OpenShift Merge Robot 373267d103
Merge pull request #15817 from edsantiago/docs_dedup_dns
[CI:DOCS] Man pages: Refactor common options: --dns
2022-09-16 11:33:44 +02:00
OpenShift Merge Robot ccee741973
Merge pull request #15829 from edsantiago/shlint
Cleanup: fix problems reported by shell lint
2022-09-16 09:55:56 +02:00
Toshiki Sonoda d63e49a26a remote: checkpoint --export prints a rawInput or an error on remote
This commit fixes `container checkpoint --export`
to print a rawInput or an error.

Fixes: #15743

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-09-16 16:46:14 +09:00
OpenShift Merge Robot 0e3a0ec7d4
Merge pull request #15825 from edsantiago/fix_readthedocs
[CI:DOCS] Fix broken titles on readthedocs
2022-09-16 09:41:53 +02:00
OpenShift Merge Robot a8a56b188c
Merge pull request #15722 from edsantiago/treadmill_improvements
[CI:DOCS] Buildah treadmill script: various fixes
2022-09-16 09:39:04 +02:00
Ed Santiago cfbc4aaeb5 Cleanup: fix problems reported by shell lint
Followup to #15616, which is not usable as it is (way, way, way
too much noise) but actually found a few real nits that should
be fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-15 20:10:34 -06:00
Ed Santiago e2573b734e Fix broken titles on readthedocs
Followup to #15621, which (correctly) removed parentheses from
md files. Turns out, a hidden part of our readthedocs process
depended on those parentheses. Update that step so it handles
the new, correct, <space><section-number> format.

Also update local-testing documentation in README, and clean it
up a little.

Fixes: #15822

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-15 14:35:06 -06:00
OpenShift Merge Robot 750726e62c
Merge pull request #15821 from vrothberg/revert-c20abf12c714f359c7bbb291c444530f70cb1185
Revert "generate systemd: drop ExecStop"
2022-09-15 21:32:39 +02:00
OpenShift Merge Robot df73f606ef
Merge pull request #15757 from mheon/fix_15526
Introduce graph-based pod container removal
2022-09-15 21:01:23 +02:00
Ed Santiago 62d1c487d9 Man pages: Refactor common options: --dns
Only between podman-build, create, and run. podman-pod-create
is too different.

As usual I went with the podman-run version. This means
keeping the word "flag" (which should be "option"), for
ease of review. I will fix in my in-progress cleanup PR.

For podman-build, I removed "during the build" and changed
it to a note for that man page only.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-15 10:12:34 -06:00
Ed Santiago 7d1f688ff9 [CI:DOCS] man pages: document some --format options
Baby steps toward merging #14046: document a few of the Go format
command-line options.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-15 09:59:32 -06:00
Valentin Rothberg 884fd4575c Revert "generate systemd: drop ExecStop"
This reverts commit c20abf12c7. In the
absence of `ExecStop` step, systemd will send the stop/kill signals to
the main PID while I asummed that systemd would jump directly to an
ExecStopPost step instead.

Hence revert the commit to let Podman take care of stopping rather than
systemd.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-15 17:56:45 +02:00
OpenShift Merge Robot 50c538b3cc
Merge pull request #15792 from dfr/freebsd-inspect
Add support for 'podman inspect' on FreeBSD
2022-09-15 17:28:51 +02:00
OpenShift Merge Robot 50142678e4
Merge pull request #15816 from vrothberg/15686-drop-execstop
generate systemd: drop ExecStop
2022-09-15 17:07:59 +02:00
OpenShift Merge Robot 05e8d564ca
Merge pull request #15815 from edsantiago/docs_dedup_no-stream
[CI:DOCS] Man pages: refactor common options: 2 stats opts
2022-09-15 14:06:13 +02:00
Ed Santiago 9ba034293d Man pages: refactor common options: 2 stats opts
--no-reset and --no-stream, in podman-stats and pod-stats.

Very minor tweak to --no-stream to account for pods.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-15 05:17:25 -06:00
Valentin Rothberg c20abf12c7 generate systemd: drop ExecStop
Drop the ExecStop step to simplify the generated units a bit.

The extra ExecStopPost step was added by commit e5c3432944. If the
main PID (i.e., conmon) is killed, systemd will not execute ExecStop
(since the main PID is already down) but only execute the *Post steps.
Credits to the late Ulrich Obergfell for tracking this issue down; he is
missed.

The ExecStop step can safely be dropped since the Post step will take of
stopping (and removing) in any case.

Context: #15686
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-15 13:15:35 +02:00
OpenShift Merge Robot 2a8df49c2a
Merge pull request #15811 from giuseppe/fix-memory-stats-api
stats: cap memory limit to the available memory
2022-09-15 12:12:48 +02:00
OpenShift Merge Robot c8bd81caca
Merge pull request #15810 from edsantiago/docs_dedup_shmsize
[CI:DOCS] Man pages: refactor common options: --shm-size
2022-09-15 12:02:29 +02:00
OpenShift Merge Robot 89cd311a1b
Merge pull request #15781 from cevich/fix_win_installer_clone
Cirrus: Fix win_installer task clone failure
2022-09-15 11:43:57 +02:00
Doug Rabson 45d09e65b8 libpod: Make getContainerInspectData work on FreeBSD
This makes setting EffectiveCaps and BoundingCaps conditional on whether
the capabilites field in the spec is non-nil.  This allows 'podman inspect'
to work on FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-15 08:10:35 +01:00
Doug Rabson 2e4db139ac libpod: Factor out platform-specfic code from generateInspectContainerHostConfig
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-15 08:10:34 +01:00
Giuseppe Scrivano 60ef4ad1c8
stats: cap memory limit to the available memory
Docker compatibility: cap the memory limit reported by the cgroup to
the maximum available memory.

Closes: https://github.com/containers/podman/issues/15765

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-15 09:00:03 +02:00
Giuseppe Scrivano cf2118eab3
stats: map MaxUsage to the correct value
and make sure it is not set for cgroup v2

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-15 00:51:56 +02:00
Ed Santiago 3f8591c2fc Man pages: refactor common options: --shm-size
Mostly went with the podman-run version. For ease of review, I
kept the "you" word -- I will fix that in my in-progress
cleanup PR.

This affects lots of files, each of which had slightly different
wording, but this actually isn't as bad as it looks. The diffs
were minor, and I'm pretty sure the new refactored text applies
equally well to all the man pages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-14 14:31:32 -06:00
OpenShift Merge Robot a73b150e70
Merge pull request #15786 from edsantiago/format_test_fixes
System tests: cleanup in --format test
2022-09-14 22:31:21 +02:00
OpenShift Merge Robot 4fc18d07a6
Merge pull request #15799 from mheon/fix_2126697
Ensure that a broken OCI spec does not break inspect
2022-09-14 21:55:13 +02:00
OpenShift Merge Robot bb4872e2f6
Merge pull request #15809 from edsantiago/docs_dedup_user
[CI:DOCS] Man pages: refactor common options: --user
2022-09-14 21:50:21 +02:00
OpenShift Merge Robot 9b6cb7e80f
Merge pull request #15794 from edsantiago/bats_races
System tests: fix three races
2022-09-14 21:33:40 +02:00
Ed Santiago f76390d5e6 Man pages: refactor common options: --user
In podman-create, exec, and run. Went with the podman-run version.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-14 12:32:30 -06:00
OpenShift Merge Robot 5d1144062a
Merge pull request #15793 from giuseppe/fix-volume-subpath-lookup
libpod: fix lookup for subpath in volumes
2022-09-14 20:28:32 +02:00
OpenShift Merge Robot dca6d316cc
Merge pull request #15802 from edsantiago/docs_dedup_preserve_fds
[CI:DOCS] Man pages: refactor common options: --preserve-fds, -it
2022-09-14 20:25:38 +02:00
Matthew Heon e19e0de5fa Introduce graph-based pod container removal
Originally, during pod removal, we locked every container in the
pod at once, did a number of validity checks to ensure everything
was safe, and then removed all the containers in the pod.

A deadlock was recently discovered with this approach. In brief,
we cannot lock the entire pod (or much more than a single
container at a time) without causing a deadlock. As such, we
converted to an approach where we just looped over each container
in the pod, removing them individually. Unfortunately, this
removed a lot of the validity checking of the earlier approach,
allowing for a lot of unintended bad things. Infra containers
could be removed while containers in the pod still depended on
them, for example.

There's no easy way to do validity checks while in a simple loop,
so I implemented a version of our graph-traversal logic that
currently handles pod start. This version acts in the reverse
order of startup: startup starts from containers which depend on
nothing and moves outwards, while removal acts on containers which
have nothing depend on them and moves inwards. By doing graph
traversal, we can guarantee that nothing is removed while
something that depends on it still exists - so the infra
container should be the last thing in a pod that is removed, for
example.

In the (unlikely) case that a graph of the pod's containers
cannot be built (most likely impossible without database editing)
the old method of pod removal has been retained to ensure that
even misbehaving pods can be forcibly evicted from the state.

I'm fairly confident that this resolves the problem, but there
are a lot of assumptions around dependency structure built into
the original pod removal code and I am not 100% sure I have
captured all of them.

Fixes #15526

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-09-14 13:44:48 -04:00
Chris Evich 51a8635c71
Cirrus: Fix win_installer task clone failure
Fix error in this task happening on `main`:

    Failed to force reset to 5ab...6d4: object not found!

Ref: https://cirrus-ci.com/task/6674361678561280?logs=clone#L2

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-09-14 13:27:40 -04:00
Chris Evich cb6ad76310
Cirrus: Only run unit-testing on Fedora.
There's little practical reason to execute unit-level testing on
multiple platforms, since there's so little platform interaction.
Remove the unit-test runs on Ubuntu, only execute on root-full and
root-less Fedora.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-09-14 13:26:57 -04:00
Ed Santiago 88879d588c System tests: cleanup in --format test
Followup to #15673 (--format with newlines). I cobbled up a test
for it, but I was sloppy, so the test had issues that I kept
having to band-aid. This is a cleaner way to handle podman-machine.

...and, another unexpected surprise with podman stats. It
fails under rootless cgroupsv1. We can't sweep it under the
rug via skip_if_ubuntu because tests will then fail on RHEL8.
So, add a similar mechanism for testing podman stats.

...plus a non-surprise, the 'search' test flakes. Try minimizing
that by searching only $IMAGE. If quay.io is down, other tests
will certainly fail.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-14 10:59:27 -06:00
Ed Santiago d4a62ff932 System tests: fix three races
Three tests were running 'container rm' on 'start'ed containers
that might not yet have exited. Fix. Also, tighten up the
tests themselves, to make even more sure that they test
what they're supposed to test.

Discovered, in CI, that 'podman-remote logs --timestamps'
was unimplemented. Thanks to @Luap99 for the fix to that.

Fixes: #15783
Fixes: #15795

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-14 10:49:18 -06:00
Giuseppe Scrivano 14e5d1c15d
libpod: fix lookup for subpath in volumes
a subdirectory that is below a mount destination is detected as a
subpath.

Closes: https://github.com/containers/podman/issues/15789

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-14 17:09:04 +02:00
Giuseppe Scrivano 92dc61d5ed
libpod: rename function
the function checks if a path is under any mount, not just bind
mounts.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-14 17:08:57 +02:00
Matthew Heon 42937cd9a8 Ensure that a broken OCI spec does not break inspect
The process of saving the OCI spec is not particularly
reboot-safe. Normally, this doesn't matter, because we recreate
the spec every time a container starts, but if one was to reboot
(or SIGKILL, or otherwise fatally interrupt) Podman in the middle
of writing the spec to disk, we can end up with a malformed spec
that sticks around until the container is next started. Some
Podman commands want to read the latest version of the spec off
disk (to get information only populated after a container is
started), and will break in the case that a partially populated
spec is present. Swap to just ignoring these errors (with a
logged warning, to let folks know something went wrong) so we
don't break important commands like `podman inspect` in these
cases.

[NO NEW TESTS NEEDED] Provided reproducer involves repeatedly
rebooting the system

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-09-14 11:02:35 -04:00
OpenShift Merge Robot 017d81ddd0
Merge pull request #15788 from kolyshkin/non-crypto-id
all: stop using deprecated GenerateNonCryptoID
2022-09-14 16:17:37 +02:00
Ed Santiago b6c75a3cc5 Man pages: refactor common options: --preserve-fds, -it
Three simple options shared among podman-create, exec, run.

I mostly went with the podman-run versions. For --tty, this
means that create and exec get the long stdout/stderr note.
(The example, though, remains only in podman-run). For -i,
mostly boldspace changes.

For --preserve-fds, podman-exec now has the "not with remote"
note (which it didn't until now)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-14 08:15:46 -06:00
OpenShift Merge Robot a3876c2f85
Merge pull request #15796 from vrothberg/fix-ci
fix ci: update systemd generate unit test
2022-09-14 16:15:09 +02:00
OpenShift Merge Robot e1b3d9811a
Merge pull request #15795 from edsantiago/docs_dedup_ip6
[CI:DOCS] Man pages: refactor common options: --ip6
2022-09-14 16:09:51 +02:00
OpenShift Merge Robot 83c148c4dd
Merge pull request #15790 from Luap99/slirp-doc
[CI:DOCS] improve slirp4netns allow_host_loopback docs
2022-09-14 14:26:57 +02:00
OpenShift Merge Robot 82651e5974
Merge pull request #15769 from dfr/freebsd-stats
Add support for 'podman stats' on FreeBSD
2022-09-14 14:21:30 +02:00