summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix podman-remote run --attach stdin to show container IDBoaz Shuster2022-09-20
| | | | Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
* Merge pull request #15821 from ↵OpenShift Merge Robot2022-09-15
|\ | | | | | | | | vrothberg/revert-c20abf12c714f359c7bbb291c444530f70cb1185 Revert "generate systemd: drop ExecStop"
| * Revert "generate systemd: drop ExecStop"Valentin Rothberg2022-09-15
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c20abf12c714f359c7bbb291c444530f70cb1185. 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>
* | Merge pull request #15757 from mheon/fix_15526OpenShift Merge Robot2022-09-15
|\ \ | |/ |/| Introduce graph-based pod container removal
| * Introduce graph-based pod container removalMatthew Heon2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15792 from dfr/freebsd-inspectOpenShift Merge Robot2022-09-15
|\ \ | | | | | | Add support for 'podman inspect' on FreeBSD
| * | libpod: Make getContainerInspectData work on FreeBSDDoug Rabson2022-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | libpod: Factor out platform-specfic code from generateInspectContainerHostConfigDoug Rabson2022-09-15
| | | | | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* | | Merge pull request #15816 from vrothberg/15686-drop-execstopOpenShift Merge Robot2022-09-15
|\ \ \ | | | | | | | | generate systemd: drop ExecStop
| * | | generate systemd: drop ExecStopValentin Rothberg2022-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the ExecStop step to simplify the generated units a bit. The extra ExecStopPost step was added by commit e5c343294424. 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>
* | | | Merge pull request #15815 from edsantiago/docs_dedup_no-streamOpenShift Merge Robot2022-09-15
|\ \ \ \ | |/ / / |/| | | [CI:DOCS] Man pages: refactor common options: 2 stats opts
| * | | Man pages: refactor common options: 2 stats optsEd Santiago2022-09-15
|/ / / | | | | | | | | | | | | | | | | | | | | | --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>
* | | Merge pull request #15811 from giuseppe/fix-memory-stats-apiOpenShift Merge Robot2022-09-15
|\ \ \ | | | | | | | | stats: cap memory limit to the available memory
| * | | stats: cap memory limit to the available memoryGiuseppe Scrivano2022-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | stats: map MaxUsage to the correct valueGiuseppe Scrivano2022-09-15
| |/ / | | | | | | | | | | | | | | | and make sure it is not set for cgroup v2 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | | Merge pull request #15810 from edsantiago/docs_dedup_shmsizeOpenShift Merge Robot2022-09-15
|\ \ \ | | | | | | | | [CI:DOCS] Man pages: refactor common options: --shm-size
| * | | Man pages: refactor common options: --shm-sizeEd Santiago2022-09-14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge pull request #15781 from cevich/fix_win_installer_cloneOpenShift Merge Robot2022-09-15
|\ \ \ | |/ / |/| | Cirrus: Fix win_installer task clone failure
| * | Cirrus: Fix win_installer task clone failureChris Evich2022-09-14
| |/ | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15786 from edsantiago/format_test_fixesOpenShift Merge Robot2022-09-14
|\ \ | | | | | | System tests: cleanup in --format test
| * | System tests: cleanup in --format testEd Santiago2022-09-14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15799 from mheon/fix_2126697OpenShift Merge Robot2022-09-14
|\ \ | | | | | | Ensure that a broken OCI spec does not break inspect
| * | Ensure that a broken OCI spec does not break inspectMatthew Heon2022-09-14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15809 from edsantiago/docs_dedup_userOpenShift Merge Robot2022-09-14
|\ \ | | | | | | [CI:DOCS] Man pages: refactor common options: --user
| * | Man pages: refactor common options: --userEd Santiago2022-09-14
| | | | | | | | | | | | | | | | | | In podman-create, exec, and run. Went with the podman-run version. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | | Merge pull request #15794 from edsantiago/bats_racesOpenShift Merge Robot2022-09-14
|\ \ \ | |/ / |/| | System tests: fix three races
| * | System tests: fix three racesEd Santiago2022-09-14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15793 from giuseppe/fix-volume-subpath-lookupOpenShift Merge Robot2022-09-14
|\ \ | | | | | | libpod: fix lookup for subpath in volumes
| * | libpod: fix lookup for subpath in volumesGiuseppe Scrivano2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | libpod: rename functionGiuseppe Scrivano2022-09-14
| |/ | | | | | | | | | | | | the function checks if a path is under any mount, not just bind mounts. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | Merge pull request #15802 from edsantiago/docs_dedup_preserve_fdsOpenShift Merge Robot2022-09-14
|\ \ | |/ |/| [CI:DOCS] Man pages: refactor common options: --preserve-fds, -it
| * Man pages: refactor common options: --preserve-fds, -itEd Santiago2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15788 from kolyshkin/non-crypto-idOpenShift Merge Robot2022-09-14
|\ \ | | | | | | all: stop using deprecated GenerateNonCryptoID
| * | all: stop using deprecated GenerateNonCryptoIDKir Kolyshkin2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In view of https://github.com/containers/storage/pull/1337, do this: for f in $(git grep -l stringid.GenerateNonCryptoID | grep -v '^vendor/'); do sed -i 's/stringid.GenerateNonCryptoID/stringid.GenerateRandomID/g' $f; done Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* | | Merge pull request #15796 from vrothberg/fix-ciOpenShift Merge Robot2022-09-14
|\ \ \ | |_|/ |/| | fix ci: update systemd generate unit test
| * | fix ci: update systemd generate unit testValentin Rothberg2022-09-14
| | | | | | | | | | | | | | | | | | | | | Two PRs have been merged causing a failure in one unit test. Fix the unit test to turn CI green again. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | | Merge pull request #15795 from edsantiago/docs_dedup_ip6OpenShift Merge Robot2022-09-14
|\ \ \ | | | | | | | | [CI:DOCS] Man pages: refactor common options: --ip6
| * | | Man pages: refactor common options: --ip6Ed Santiago2022-09-14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to yesterday's --ip. No changes to content, all I did was variableize the instances of 'container'/'pod'. Did not touch podman-network-connect file, but if someone wants to look at that one and tell me whether all this long text is applicable to it (or not), I'd appreciate it. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | | Merge pull request #15790 from Luap99/slirp-docOpenShift Merge Robot2022-09-14
|\ \ \ | | | | | | | | [CI:DOCS] improve slirp4netns allow_host_loopback docs
| * | | improve slirp4netns allow_host_loopback docsPaul Holzinger2022-09-14
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The default ip is 10.0.2.2 but is always the second ip from the slirp4netns subnet, which can be changed via the cidr option. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2090166 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #15769 from dfr/freebsd-statsOpenShift Merge Robot2022-09-14
|\ \ \ | |_|/ |/| | Add support for 'podman stats' on FreeBSD
| * | libpod: Add support for 'podman stats' on FreeBSDDoug Rabson2022-09-14
| | | | | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
| * | libpod: Split out the common code from GetContainerStatsDoug Rabson2022-09-14
| | | | | | | | | | | | | | | | | | | | | | | | This moves the cgroups code to a new method getPlatformContainerStats. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
| * | libpod: Move stats.go to stats_linux.go for consistencyDoug Rabson2022-09-14
| | | | | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
| * | pkg/rctl: Add a simple FreeBSD RCTL libraryDoug Rabson2022-09-14
| |/ | | | | | | | | | | | | | | | | Initially just supporting just rctl_get_racct for (*Container).GetContainerStats. [NO NEW TESTS NEEDED] we are not running any FreeBSD tests in CI Signed-off-by: Doug Rabson <dfr@rabson.org>
* | Merge pull request #15777 from vrothberg/fix-14546OpenShift Merge Robot2022-09-14
|\ \ | | | | | | generate systemd: fix pod dependencies
| * | generate systemd: fix pod dependenciesValentin Rothberg2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the dependencies from a pod unit to its associated container units from `Requires` to `Wants` to prevent the entire pod from transitioning to a failed state. Restart policies for individual containers can be configured separately. Also make sure that the pod's RunRoot is always set. Fixes: #14546 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | | Merge pull request #15771 from dcermak/pod-systemd-exit-policyOpenShift Merge Robot2022-09-14
|\ \ \ | |_|/ |/| | [systemd] Ensure that podCreateArgs appear last in ExecStartPre=
| * | [systemd] Ensure that podCreateArgs appear last in ExecStartPre=Dan Čermák2022-09-14
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a new pod without the `--name` flag, e.g.: `podman pod create foobar` it will get the name `foobar` implicitly and this will be recorded as the in the `podCreateArgs`. Unfortunately, the implicit name only works if it appears as the **last** argument of the startup command. With 6e2e3a78ed1d05ee5f23f65b814e8135021961dd we started appending the pod security policy to the startCommand, resulting in the following `ExecStartPre=` line: ``` /usr/bin/podman pod create --infra-conmon-pidfile %t/pod-foobar.pid --pod-id-file %t/pod-foobar.pod-id foobar --exit-policy=stop ``` This fails to launch, as the `pod create` command expects only a single non-flag parameter, but it assumes that `exit-policy=stop` is a second and terminates immediately instead. This fixes https://github.com/containers/podman/issues/15592 Signed-off-by: Dan Čermák <dcermak@suse.com>
* | Merge pull request #15784 from edsantiago/docs_dedup_tlsverifyOpenShift Merge Robot2022-09-13
|\ \ | | | | | | [CI:DOCS] Man pages: refactor common options: --tls-verify