15473 Commits

Author SHA1 Message Date
ee05bc0318 Fix network inspect compat API discrepancy
- containerInspect compat API expects field value PrefixLen
  instead of PrefixLength for type Address for SecondaryIPAddresses
- Add tests for network part of containerInspect compat api

Closes: containers#14674
Signed-off-by: 🤓 Mostafa Emami <mustafaemami@gmail.com>
2022-07-05 21:25:32 +02:00
fe8e536328 Merge pull request #14556 from sstosh/system-prune-network
podman system prune support prune unused networks
2022-06-20 13:57:42 +00:00
55052c6b98 Merge pull request #14657 from eriksjolund/rewrite_env_docs
[CI:DOCS] Rewrite --env docs
2022-06-19 17:16:32 +00:00
dda68201a4 [CI:DOCS] Rewrite --env docs
* Add docs about trailing * functionality in podman-exec.1.md

* Rewrite --env description in podman-create.1.md and podman-run.1.md

* Rewrite the --env examples in podman-create.1.md and podman-run.1.md

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-06-19 09:56:46 +02:00
ff06c791ad Merge pull request #14637 from edigaryev/fix-matrix-expansion
.cirrus.yml: fix matrix expansion by properly merging YAML mappings
2022-06-17 15:58:57 +00:00
3b03bd3f78 Merge pull request #14592 from cevich/more_fix_404
Cirrus: Fix build. dep. missed in #14521
2022-06-17 15:23:44 +00:00
04de0dabce Merge pull request #14599 from rhatdan/VENDOR
Vendor in latest containers/image
2022-06-17 14:59:17 +00:00
075c9ac455 .cirrus.yml: fix matrix expansion by properly merging YAML mappings
Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
2022-06-17 15:02:01 +03:00
8090445762 vendor in latests containers/image
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-06-17 06:10:24 -04:00
c936d1e611 Merge pull request #14622 from rhatdan/storage
Vendor in latest containers/storage
2022-06-17 07:54:59 +00:00
05fc5959ec Merge pull request #14627 from cdoern/lint-fix
linter fix from #14299
2022-06-16 23:14:52 +00:00
a3b3f1723b linter fix from #14299
[NO NEW TESTS NEEDED] podman pod clone somehow snuck by the new linter code that went in while it was in flight
fix that here

Signed-off-by: cdoern <cdoern@redhat.com>
2022-06-16 16:32:01 -04:00
2af8851787 Merge pull request #14299 from cdoern/podClone
implement podman pod clone
2022-06-16 20:05:27 +00:00
065302bd58 Cirrus: Fix build. dep. missed in #14521
This is causing the remote system tests to fail when run on on `main`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-06-16 14:28:56 -04:00
5cba4dc2e4 Merge pull request #14619 from Luap99/help
fix "podman -h" help output
2022-06-16 18:06:29 +00:00
3af047b63d Vendor in latest containers/storage
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-06-16 14:05:43 -04:00
8765adb756 Merge pull request #14621 from mheon/api_sec_notice
[CI:DOCS] Make it clear the REST API could be a security issue
2022-06-16 16:37:40 +00:00
e6fe06f591 Merge pull request #14600 from edsantiago/argh
system tests: avoid rmi -a ... plus cleanup
2022-06-16 16:01:45 +00:00
09c462d735 fix "podman -h" help output
`podman -h` currently returns an error:
`Error: pflag: help requested`

This bug was introduced in 44d037898ebc, the problem is that we wrap the
error and cobra lib checks with `==` for this one and not errors.Is().
I have a PR upstream to fix this but for now this also works.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-16 16:59:47 +02:00
e3a0deadce Merge pull request #14613 from kolyshkin/fix-410-selinux
test/system/410-selinux: fix for newer runc
2022-06-16 14:33:23 +00:00
6c5e1420e2 Make it clear the REST API could be a security issue
The manpage for `podman system service` should mention that this
is not safe for external consumption unless you are comfortable
giving anyone who accesses it full root on the system.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-06-16 09:56:44 -04:00
e2255d9a68 Merge pull request #14614 from clobrano/typos/contributing
[CI:DOCS] fix typos in prerequisites for Fedora and make binaries sections
2022-06-16 13:23:29 +00:00
82936d8988 Merge pull request #14610 from shanesmith/fix-machine-start-interrupt
Fix interrupting machine start leaves the machine unstartable
2022-06-16 12:12:09 +00:00
28a38617ee [CI:DOCS] fix typos in prerequisites for Fedora and make binaries sections
- prerequisites in Fedora section has libseccomp-devel.x86_64 named twice
- bin/podman flag "-h" does not work, "--help" is required

Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
2022-06-16 10:46:14 +02:00
a90dac9454 Merge pull request #14605 from Luap99/update-golangci-lint
golangci-lint: update to v1.46.2
2022-06-16 07:32:58 +00:00
78c149ff91 Merge pull request #14529 from edsantiago/testimage_with_consistent_timestamps
system test image: bump to 20220615
2022-06-16 07:24:49 +00:00
a6226540e2 Merge pull request #14570 from Clivar/fix-windows-ssh-key-creation
Fix: Use absolute path to WSL binary to create ssh keys for `machine init` on Windows (Issue #14416)
2022-06-16 07:21:04 +00:00
b3f094a61c test/system/410-selinux: fix for newer runc
With runc 1.1, we have the following failure:

 # #|     FAIL: podman emits useful diagnostic on failure
 # #| expected: 'Error.*: OCI runtime error: .*: failed to set /proc/self/attr/keycreate on procfs' (using expr)
 # #|   actual: 'Error: OCI runtime error: runc: runc create failed: unable to start container process: error during container init: write /proc/self/attr/keycreate: invalid argument'

which is caused by the fact that runc 1.1 uses newer opencontainers/selinux
package, which changes custom errors to standard os.PathError instances (so
that they can be unwrapped if needed).

Fix the test case accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-06-15 20:26:31 -07:00
e69691c277 Fix interrupting machine start leaves the machine unstartable
Interrupting a `podman machine start` (ex: with CTRL-C) would leave
`Starting: true` in the machine's config file. Due to #14469 any
subsequent starts would fail since Podman would think the machine is
still in the process of starting.

Fixed here by listening for the interrupt signal and setting `Starting:
false` in the event.

[NO NEW TESTS NEEDED]

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-06-15 16:19:10 -04:00
0a202a9f03 system test image: bump to 20220615
Changes:
 - use --timestamp option to produce 'created' stamps
   that can be reliably tested in the image-history test

 - podman now supports manifest & multiarch run, so we
   no longer need buildah

 - bump up base alpine & busybox images

This turned out to be WAY more complicated than it should've been,
because:

 - alpine 3.14 fixed 'date -Iseconds' to include a colon in
   the TZ offset ("-07:00", was "-0700"). This is now consistent
   with GNU date's --iso-8601 format, yay, so we can eliminate
   a minor workaround.

 - with --timestamp, all ADDed files are set to that timestamp,
   including the custom-reference-timestamp file that many tests
   rely on. So we need to split the build into two steps. But:

 - ...with a two-step build I need to use --squash-all, not --squash, but:

 - ... (deep sigh) --squash-all doesn't work with --timestamp (#14536)
   so we need to alter existing tests to deal with new image layers.

 - And, long and sordid story relating to --rootfs. TL;DR that option
   only worked by a miracle relating to something special in one
   specific test image; it doesn't work with any other images. Fix
   seems to be complicated, so we're bypassing with a FIXME (#14505).

And, unrelated:

 - remove obsolete skip and workaround in run-basic test (dating
   back to varlink days)
 - add a pause-image cleanup to avoid icky red warnings in logs

Fixes: #14456

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-06-15 13:29:08 -06:00
21819254dd golangci-lint: update to v1.46.2
Update to the latest golangci-lint version. v1.46 added new linters.
I disabled nonamedreturns and exhaustruct since they enforce a certain
code style and using them would require big changes to the code base.

The nosprintfhostport is new and I fixed one problem in the tests. While
the test itself is fine because it uses ipv4 only the linter still looks
good because the sprintf use will fail for ipv6 addresses.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-15 19:58:30 +02:00
c6b9baa6c1 system tests: avoid rmi -a ... plus cleanup
I noticed 'rmi -a' in a test. I tried to fix it. Hilarity ensued.

'rmi -a' is evil: it forces a fresh pull of our test image,
which in turn almost guarantees a flake some day. We avoid
it, but once in a while it slips in.

While fixing it, I noticed a bevy of other problems that
needed cleanup.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-06-15 10:47:42 -06:00
31095349e3 Merge pull request #14601 from mheon/bump_main_411
[CI:DOCS] Update release notes and README on Main for v4.1.1
2022-06-15 16:21:26 +00:00
ed755cb14e Merge pull request #14596 from giuseppe/move-conmon-different-cgroup-system-service
libpod: improve check to create conmon cgroup
2022-06-15 16:18:18 +00:00
08f35dab5a Merge pull request #14598 from Luap99/service-systemd-fd
systemd socket activation: check listener to prevent panic
2022-06-15 09:52:38 -06:00
693d439ac5 Update release notes and README on Main for v4.1.1
Redirect links to the new release, and update the release notes.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-06-15 11:16:38 -04:00
751ba07a76 libpod: improve check to create conmon cgroup
commit 1951ff168a63157fa2f4711fde283edfc4981ed3 introduced a check so
that conmon is not moved to a new cgroup when podman is running inside
of a systemd service.  This is helpful to integrate podman in systemd
so that the spawned conmon lives in the same cgroup as the service
that created it.

Unfortunately this breaks when podman daemon is running in a systemd
service since the same check is in place thus all the conmon processes
end up in the same cgroup as the podman daemon.  When the podman
daemon systemd service stops the conmon processes are also terminated
as well as the containers they monitor.

Improve the check to exclude podman running as a daemon.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2052697

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-15 15:43:12 +02:00
90a669594a fix CI: golangci-lint is broken on main
The merge of both 528739cef3d2 and 1b62e4543845 at the same time created
a lint error on main.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-15 14:57:10 +02:00
20b3fbe6d6 systemd socker activation: check listener to prevent panic
Commit 5fa6f686db added a regression which was fixed in eb71712626f9.
Apply the same fix again to prevent a panic and return a proper error
instead.

To not regress again I added a e2e test which makes sure we do not panic.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-15 14:33:14 +02:00
cab97798bf Merge pull request #14584 from Luap99/lint-systemd
golangci-lint: add systemd build tag
2022-06-15 00:49:10 -04:00
43e12c135b Fix #14416: Use absolute path to WSL binary to create ssh keys for machine init
Signed-off-by: Clivar <16317699+Clivar@users.noreply.github.com>
2022-06-15 00:16:06 +02:00
e084f0ee1e Merge pull request #14585 from Luap99/nolint
golangci-lint: enable nolintlint
2022-06-14 18:58:53 +00:00
4018a9575e Merge pull request #14582 from giuseppe/no-create-containerenv-if-run-volume
container: do not create .containerenv with -v SRC:/run
2022-06-14 18:55:49 +00:00
a22e270ef6 Merge pull request #14324 from anjannath/qemu-test
[macos: podman-machine] look for firmware (edk2-code-fd) based on the path of qemu binary
2022-06-14 18:02:27 +00:00
1cf3e4cda4 Merge pull request #14551 from edsantiago/apiv2_tests_rootless
CI: APIv2 tests: add rootless
2022-06-14 17:31:38 +00:00
071b925dec Merge pull request #14588 from edsantiago/eek_buildah_bud_coverage
buildah-bud tests: reenable skipped 'bud' tests
2022-06-14 17:17:40 +00:00
ea18b9463e Merge pull request #14581 from edsantiago/bud_test_check_skip_syntax
buildah-bud tests: add arg sanity check
2022-06-14 16:45:14 +00:00
bfc446eea3 buildah-bud tests: reenable skipped 'bud' tests
Sigh. Buildah PR https://github.com/containers/buildah/pull/3368
changed 'bud' to 'build' in tests. Podman #11585 well-intentionedly
did the same for run-buildah-bud tests ... but did so by *replacing*
'bud' with 'build', not by *adding* 'build' to the list of commands
handled by podman-build. Hence, all tests invoking 'run_buildah bud'
have been completely untested since then.

This remedies that, and deals with all the fallout. Principal among
which is the discovery that our exit-code changes are no longer
necessary: that thing we did where buildah exit status 1 or 2 became
podman exit status 125? That no longer applies. podman now exits
with the same status as buildah. This simplifies our diffs, and
lets us enable a bunch more tests.

Also:
 - in run-buildah-bud-tests script, run 'sudo --validate' early on.
   Reason: otherwise, the sudo step happens a few minutes after
   the script starts (after the git-pull), by which time the user
   may have stepped away to get coffee, then comes back ten or twenty
   minutes later to find a stupid sudo prompt and no tests run.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-06-14 10:12:54 -06:00
455f4c7828 CI: APIv2 tests: add rootless
This would've caught a regression that #14549 had to fix.
Let's try to prevent the next regression.

This requires some hackery to get namespaces initialized
before the service is started; otherwise the service itself
initializes namespaces, which basically ends up with a
server process that runs forever.

Also: in stop_service(), reset service_pid, because that's
the correct thing to do.

Also: add some debug statements to try to figure out a
CI failure. (And leave them in place, because they might
be useful for future problems).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-06-14 09:20:24 -06:00
232b3e342a buildah-bud tests: add arg sanity check
Fix bad design decision (mine) by adding a simple usage check to 'skip'
and 'skip_if_remote' functions: if invoked without test-name args,
fail loudly and immediately.

Background: yeah, their usage is not intuitive. Making the first arg
be a comment helps with _reading_ the code, but not _writing_ new
additions. A developer in a hurry could write "skip this-test" and,
until now, that would be a silent NOP.

Tested by adding broken skip/skip_if_remote calls inline; I confirm
that the line number and funcname usage is correct.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-06-14 08:56:28 -06:00