16553 Commits

Author SHA1 Message Date
dd53ee5998 fix ci: update systemd generate unit test
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>
2022-09-14 14:13:33 +02:00
ae20f19351 Merge pull request #15777 from vrothberg/fix-14546
generate systemd: fix pod dependencies
2022-09-14 13:08:04 +02:00
9401268360 Merge pull request #15771 from dcermak/pod-systemd-exit-policy
[systemd] Ensure that podCreateArgs appear last in ExecStartPre=
2022-09-14 13:05:29 +02:00
0aedddd3b3 [systemd] Ensure that podCreateArgs appear last in ExecStartPre=
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>
2022-09-14 09:37:02 +02:00
c64388728f Merge pull request #15784 from edsantiago/docs_dedup_tlsverify
[CI:DOCS] Man pages: refactor common options: --tls-verify
2022-09-13 21:00:16 +02:00
ad529f31d8 Merge pull request #15673 from Luap99/template
Fix go template parsing with "\n" in it
2022-09-13 20:26:24 +02:00
76eb06330f Man pages: refactor common options: --tls-verify
Ugh. This had about five different variations among twelve files.
I went with the version from podman-create, kube play, login, pull,
push, run. The others:

 - manifest-add and create did not include the "true, false, missing"
   text. Now they do. (If this text is N/A to these two, please yell).
   Also, these two were written with "talking" instead of "contacting"
   the registry.

 - podman-build had "does not work with remote", but this
   does not seem to be true, so I removed it. None of the
   other files had that.

 - the wording in podman-search is just weird, with "if needed"
   and "is listed" and unclear "insecure registries". I just
   nuked it all. If that wording was deliberate, for some reason
   that applies only to podman-search, please yell.

 - podman-container-runlabel has one diff that I like, actually
   spelling out containers-registries.conf(5), but incorporating
   that would make this even harder to review. I will add that
   to my in-progress doc-cleanup PR.

Review recommendation: run hack/markdown-preprocess-review but
just quit out of it immediately (on both popups). Ignore it completely.
Then cd /tmp/markdown-preprocess-review.diffs/tls-verify and run

    $ clear;for i in podman-*;do echo;echo $i;wdiff -t $i zzz-chosen.md;done

This will show the major diffs between each version and the chosen one.
Assumes you have wdiff installed. If you have another colorize-actual-
individual-word-diffs tool installed, use that. I like cdif[1].

 [1] https://github.com/kaz-utashiro/sdif-tools

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 11:15:23 -06:00
6e382d9ec2 Merge pull request #15779 from edsantiago/docs_dedup_publish
[CI:DOCS] Man pages: Refactor common options: --publish
2022-09-13 18:24:01 +02:00
fe04c86a24 generate systemd: fix pod dependencies
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>
2022-09-13 17:25:48 +02:00
d4a0003122 Man pages: Refactor common options: --publish
Almost identical between podman-create, run, and pod-create.
The "Notes" are different, so I left those duplicated between
podman-create and run, and left the different one in pod-create.

podman-container-restore also has --publish but it's unrelated.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 09:02:34 -06:00
9d41b95d72 rework --format system test
This version does a much better job of error reporting and also catches
more commands.

Changes from edsantiago.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 17:02:15 +02:00
4ff5bd8542 Merge pull request #15773 from edsantiago/docs_dedup_publish_all
[CI:DOCS] Man pages: refactor common options: --publish-all
2022-09-13 17:00:51 +02:00
7e03a497d1 Merge pull request #15772 from edsantiago/autolabel_api_change
[CI:BUILD] Enable github labeler, use for api-change
2022-09-13 16:37:54 +02:00
dacd594247 Man pages: refactor common options: --publish-all
Only shared between podman-create and run. The latter was
updated in #5192, and that is the text I chose.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 07:51:39 -06:00
885bc4742d Enable github labeler, use for api-change
Belated followup to #11829: use github labeler workflow[1] to
auto-add 'kind/api-change' label to PRs in which files are
touched under pkg/api

 [1] https://github.com/actions/labeler

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 07:36:45 -06:00
07c0dd1f24 Merge pull request #15770 from edsantiago/docs_dedup_os.pull
[CI:DOCS] Man pages: refactor common options: --os (pull)
2022-09-13 15:23:23 +02:00
51b5d30b10 Merge pull request #15721 from edsantiago/instrument_metacopy_flake
TEMPORARY: instrumenting for 15488
2022-09-13 15:14:47 +02:00
74e0511c96 Man pages: refactor common options: --os (pull)
Only shared by podman-create, -pull, -run. No changes
made other than whitespace, so this should be a gimme.

podman-build, import, and manifest-* also have --os options,
but those are unrelated and I can't find a way to combine
any two of them.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 06:35:15 -06:00
68eb82ceb2 Merge pull request #15768 from edsantiago/docs_dedup_ip
[CI:DOCS] Man pages: refactor common options: --ip
2022-09-13 14:25:07 +02:00
351b303119 Merge pull request #15752 from vrothberg/fix-15691
health checks: restart timers
2022-09-13 14:22:34 +02:00
d88d74639f Merge pull request #15753 from mheon/fix_15720
Ensure that the DF endpoint updated volume refcount
2022-09-13 13:35:10 +02:00
f30d4852ef Man pages: refactor common options: --ip
Between podman-create, run, and pod-create. The big difference
is that I changed 'IP' to 'IPv4' in podman-pod-create, I believe
that was an oversight in #12611.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 05:14:25 -06:00
c0dd0d696e Merge pull request #15766 from vrothberg/fix-15284
generate systemd: warn on --restart without --new
2022-09-13 13:00:23 +02:00
eb69259305 Merge pull request #15767 from dfr/freebsd-events
events: Fix spelling of newNullEventer
2022-09-13 12:33:57 +02:00
1b3e8639f3 Merge pull request #15750 from containers/dependabot/go_modules/github.com/vbauerster/mpb/v7-7.5.3
build(deps): bump github.com/vbauerster/mpb/v7 from 7.5.2 to 7.5.3
2022-09-13 11:09:26 +02:00
0ea5080c91 generate systemd: warn on --restart without --new
Emit a warning to the user when generating a unit with --new on a
container that was created with a custom --restart policy. As shown
in #15284, a custom --restart policy in that case can lead to issues
on system shutdown where systemd attempts to nuke the unit but Podman
keeps on restarting the container.

Fixes: #15284
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-13 10:59:57 +02:00
c8c2aab50d health checks: restart timers
Restart the health-check timers instead of starting them.  This will
surpress annoying errors stating that an already running timer cannot be
started anymore.

Also make sure that the transient units/timers are stopped and removed
when stopping a container.

Fixes: #15691
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-13 10:56:44 +02:00
908458d063 enable podman pod inspect --format test
Now that commit d10e77e1bcd2 is merged, it will reuse the same template
logic as inspect and therefore should just work.

Also remove the FIXME from eds test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:15 +02:00
7f8e99ded4 podman version: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:15 +02:00
0c21dcf70c podman machine info: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:14 +02:00
e5389e98f7 podman info: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:14 +02:00
1acebdda37 tests for 15673
Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-13 10:33:14 +02:00
43f7bdf822 podman inspect return exit code > 0 on print error
Unlikely to happen but when there is an error printing the data to
stdout (either as json or go template) we should not just log it and
exit with 0. Instead return a proper error and exit with 125.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:14 +02:00
00240a0e2e podman inspect: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:14 +02:00
377599f1f4 podman secret inspect: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:13 +02:00
f5e13ded93 podman secret ls: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:13 +02:00
1463898b07 podman network ls: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:13 +02:00
90634d5ee2 podman volume ls: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

Also fixa bug since the table format is expected to print headers as
well.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:13 +02:00
20eccfc9d0 podman machine inspect: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

Also fix a bug where a invlaid template would not cause a exit code > 0,
see the added test case.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:13 +02:00
a687949dbc podman machine ls: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:12 +02:00
65e78d92c9 podman auto-update: use report.Formatter over Template
Currently the podman command --format output code uses a mix of
report.Formatter and report.Template.

I patched report.Formatter to correctly handle newlines[1]. Since we
cannot fix this with report.Template we have to migrate all users to
report.Formatter. This ensures consistent behavior for all commands.

This change does not change the output, we can add a new test for the
newline bug when the common PR is vendored in.

[1] https://github.com/containers/common/pull/1146

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-09-13 10:33:12 +02:00
0f39129551 Merge pull request #15758 from edsantiago/docs_dedup_rootfs
[CI:DOCS] Man pages: refactor common options: --rootfs
2022-09-13 10:06:44 +02:00
70e6b19d4d events: Fix spelling of newNullEventer
This function changed from public to private which broke the FreeBSD build.

Sadly, adding FreeBSD to the cross build isn't currently possible since
github.com/godbus/dbus relies on cgo on FreeBSD. I've tried to fix this
upstream but my PR is going nowhere - I think this dependency is only
needed for systemd which isn't a thing on FreeBSD so it might be
possible to work around the problem in libpod by making the systemd code
conditional on linux.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-13 08:38:13 +01:00
9457549fff build(deps): bump github.com/vbauerster/mpb/v7 from 7.5.2 to 7.5.3
Bumps [github.com/vbauerster/mpb/v7](https://github.com/vbauerster/mpb) from 7.5.2 to 7.5.3.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v7.5.2...v7.5.3)

---
updated-dependencies:
- dependency-name: github.com/vbauerster/mpb/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Also bump the go module to 1.17 to be able to compile the new code.
Given containers/common and others already require go 1.17+ we're
safe to go.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-13 08:58:22 +02:00
09ba2e0b9e Man pages: refactor common options: --rootfs
podman-create and -run only. The SELinux text was added
to podman-run (but not -create) in #3631, and reformatted
in #5192. I assume here that it also applies to podman-create.

Per feedback from Dan, added :s0 to SELinux context

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-12 17:56:57 -06:00
4aeaeafde5 Merge pull request #15678 from edsantiago/bats_cleanup
system tests: periodic cleanup and fixes
2022-09-12 23:17:56 +02:00
07a8eb8295 Ensure that the DF endpoint updated volume refcount
The field was already exposed already in the `system df` output
so this just required a bit of plumbing and testing.

As part of this, fix `podman systemd df` volume in-use logic.
Previously, volumes were only considered to be in use if the
container using them was running. This does not match Docker's
behavior, where a volume is considered in use as long as a
container exists that uses the volume, even if said container is
not running.

Fixes #15720

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-09-12 16:43:24 -04:00
8216d0ef4e Merge pull request #15749 from dfr/freebsd-networking
Add support for networking on FreeBSD
2022-09-12 21:14:40 +02:00
e24c2f0099 system tests: periodic cleanup and fixes
- basic       : add actual log-level tests
- events      : clean up, add --format tests
- systemd     : reorder proxy args for legibility
- auto-update : fix missing timeout that could lead to hang

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-12 12:17:51 -06:00
6e545945a5 Merge pull request #15717 from Luap99/events
fix several podman events issues
2022-09-12 19:55:15 +02:00