16511 Commits

Author SHA1 Message Date
1ed9a47409 Man pages: refactor common options: --restart
Only applicable to podman-create and -run. I went with the -run
version because it is cleaner and more recently updated.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-30 08:35:53 -06:00
98169c20dd Add emptyDir volume support to kube play
When a kube yaml has a volume set as empty dir, podman
will create an anonymous volume with the empty dir name and
attach it to the containers running in the pod. When the pod
is removed, the empy dir volume created is also removed.

Add tests and docs for this as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-08-30 10:34:45 -04:00
57441b4c71 Merge pull request #15545 from edsantiago/docs_dedup_subxidname
[CI:DOCS] Man pages: refactor common options: --subXidname
2022-08-30 10:32:23 -04:00
40627e08a4 Merge pull request #15517 from tyler92/remove-libnetwork-dep
remove github.com/docker/libnetwork dependency
2022-08-30 10:29:36 -04:00
8637548a36 docs: move userns options to separate file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-30 15:10:41 +02:00
e015c9e3f7 podman: add uid and gid options to keep-id
add two new options to the keep-id user namespace option:

- uid: allow to override the UID used inside the container.
- gid: allow to override the GID used inside the container.

For example, the following command will map the rootless user (that
has UID=0 inside the rootless user namespace) to the UID=11 inside the
container user namespace:

$ podman run --userns=keep-id:uid=11 --rm -ti  fedora cat /proc/self/uid_map
         0          1         11
        11          0          1
        12         12      65525

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-30 14:39:27 +02:00
cd62606046 infra: remove dead code
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-30 14:39:27 +02:00
62d87aa9ba Man pages: refactor common options: --subXidname
Whew! This one started off identical everywhere, but the version
in podman-run got fixed in #1380, then again in #5192, with no
corresponding fixes to any of the other man pages.

I went with the podman-run version, with a small change in wording.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-30 05:28:28 -06:00
7f141a71a2 Merge pull request #15532 from edsantiago/docs_dedup_httpproxy
[CI:DOCS] Man pages: refactor common options: --http-proxy
2022-08-30 07:08:23 -04:00
08a2851bae Allow to override default username via command line
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-30 13:35:07 +03:00
4781bc7fe7 specgen/generate: Add support for FreeBSD
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-30 11:24:57 +01:00
68f4dcf00a specgen/generate: Move specConfigNamespaces to namespace_linux.go and add stubs
Everthing except for hostname management is linux-specific.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-30 11:24:38 +01:00
39880670cd specgen/generate: Move SpecGenToOCI, WeightDevices to oci_linux.go and add stubs.
Almost all of SpecGenToOCI deals with linux-specific aspects of the
runtime spec. Rather than try to factor this out piecemeal, I think it
is cleaner to move the whole function along with its implementation
helper functions. This also meams we don't need non-linux stubs for
functions called from oci_linux.go

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-30 11:23:58 +01:00
be77c15e55 Merge pull request #15536 from edsantiago/lock_5000
e2e tests: try to deflake 5000
2022-08-30 05:50:05 -04:00
a240146a2d e2e tests: try to deflake 5000
We keep getting flakes in tests that use port 5000. Try to
find and fix, by switching ports where possible, and locking
5000 when not possible (or not easy) to switch.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-29 14:11:46 -06:00
0e53c8c735 Merge remote-tracking branch 'upstream/main' into api_compat_containers 2022-08-29 15:48:02 -04:00
468aa6478c Merge pull request #15457 from lsm5/packit-fix-spec-file-action
[CI:BUILD] Packit: Re-introduce packit with fix-spec-file action
2022-08-29 14:14:58 -04:00
08af95f635 updated apiv2 tests to reflect hash compat fix
Signed-off-by: Jason Ertel <jason.ertel@securityonionsolutions.com>
2022-08-29 14:10:33 -04:00
c1480b39a9 Improved Windows compatibility for machine command
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2022-08-29 16:53:42 +03:00
4e18c8100f Man pages: refactor common options: --http-proxy
Only between podman-create and -run. (podman-build is too
different). I went with the podman-run version.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-29 06:47:07 -06:00
00b03db6f2 Merge pull request #15528 from edsantiago/docs_dedup_dnsopt
[CI:DOCS] Man pages: refactor common options: --dns-*
2022-08-29 08:45:45 -04:00
0166feef2a specgen/generate: Move security.go to security_linux.go and add stubs
The security features (selinux, apparmor, capabilities) are linux
specific.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-29 13:06:15 +01:00
a7d7912029 libpod: Make sure writeConmonPipeData is called on FreeBSD
I managed to miss this while factoring out moveConmonToCgroupAndSignal.
Perhaps the signalling part should move to the caller instead?

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-29 13:04:04 +01:00
d19438fa6d Man pages: refactor common options: --dns-*
--dns-opt and --dns-search, but only in podman-create and -run.
Went with the -run version in both cases; --dns-opt remained
unchanged, but in --dns-search I changed 'and' to 'with'.

Did not consolidate podman-build or podman-pod-create: too
different.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-08-29 05:37:52 -06:00
cf20e6ed39 Merge pull request #15481 from edsantiago/test_cleanup_apiv2
APIv2 test cleanup, part 2 of 2
2022-08-29 07:08:51 -04:00
e78363d24c Merge pull request #15516 from kubealex/handle-connected-network
Handle an already connected network in libpod API
2022-08-29 06:56:15 -04:00
3a63420628 Merge pull request #15500 from dfr/freebsd-terminal
pkg/domain: Add terminal support for FreeBSD
2022-08-29 06:27:24 -04:00
7287f9e49a Merge pull request #15504 from lsm5/aws-meta
[CI:DOCS] Cirrus: Update meta-task for EC2 image
2022-08-29 06:01:16 -04:00
dcb4d43570 [makefile] disable security labeling instead of using --privileged
$(CURDIR) is mounted in podman as is which causes issues on systems with SELinux
as then the container cannot read or write anything inside /src/. This has been
worked around with the --privileged flag, but that's a rather brutal
solution. Adding :Z is also suboptimal, as that requires a full relabeling after
every run. Instead, we disable security labeling via `--security-opt
label=disable` for this development container allowing us to run `make
vendor-in-container` unprivileged.

Signed-off-by: Dan Čermák <dcermak@suse.com>
2022-08-29 09:03:52 +02:00
78aec21302 Fix #15499 already connected network
Compat: Treat already attached networks as a no-op
Applies only to containers in created state. Maintain error in running state.

Co-authored-by: Alessandro Rossi <al.rossi87@gmail.com>
Co-authored-by: Brent Baude <bbaude@redhat.com>
Co-authored-by: Jason T. Greene <jason.greene@redhat.com>
Signed-off-by: Alessandro Rossi <al.rossi87@gmail.com>
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-08-27 20:03:40 -05:00
b4f5a246a2 remove github.com/docker/libnetwork dependency
Code from this dependency was replaced with a simple version. As a
result Podman's memory consumption has been reduced by ~10%.

[NO NEW TESTS NEEDED]

Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
2022-08-27 21:46:10 +03:00
0ee9a3129b podman rmi: emit untag events
Emit untag events for each tag when removing an image.

Fixes: #15485
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-08-27 13:40:50 +02:00
d68eea6014 Merge pull request #15507 from patrycja-guzik/docs-examples
[CI:DOCS] Fix example sections to follow the same format
2022-08-27 07:23:08 -04:00
0b3184a5ac pkg/domain: Add terminal support for FreeBSD
This just moves the code to files which can be shared with freebsd.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-27 08:08:23 +01:00
11de12097f Fix example sections to follow the same format
Signed-off-by: patrycja-guzik <patrycja.k.guzik@gmail.com>
2022-08-27 00:10:34 +02:00
b1cbcff5c5 Merge pull request #15494 from vrothberg/fix-15492
libpod: UpdateContainerStatus: do not wait for container
2022-08-26 16:23:46 -04:00
e4f816fdb4 [CI:DOCS] Cirrus: Update meta-task for EC2 image
Copied from: https://github.com/containers/aardvark-dns/pull/207

Fixes: #15502

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-08-26 15:41:17 -04:00
ff96bc47e3 Merge pull request #15496 from returntrip/patch-2
[CI:DOCS] - Fix: template name inconsistency
2022-08-26 14:35:46 -04:00
8096b18077 Merge pull request #15503 from giuseppe/make-move-to-sub-cgroup-non-fatal
service: make move to sub-cgroup non fatal
2022-08-26 14:33:12 -04:00
e448122fef service: make move to sub-cgroup non fatal
if we are running in a container in the root cgroup, Podman tries to
move itself to a sub-cgroup.  This could be a problem in a setup where
the cgroups are not writeable, so just log a debug message and
continue, since anyway it is a best-effort operation.

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

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-08-26 18:06:42 +02:00
e47b54df3b Merge pull request #15495 from containers/dependabot/go_modules/github.com/vbauerster/mpb/v7-7.5.2
Bump github.com/vbauerster/mpb/v7 from 7.4.2 to 7.5.2
2022-08-26 12:00:52 -04:00
167b026e7d [CI:BUILD] Packit: Re-introduce packit with fix-spec-file action
Any new files installed by new PRs and those present in unreleased
versions of Podman will need additional manipulation of the
dist-git spec file in the files section to workaround the
`installed but unpackaged files` issue.

The fix-spec-file packit action is useful for this.

The default fix-spec-file action often has trouble guessing the correct
version from upstream code, so it would be beneficial to specify the
correct upstream version as well.

See: https://packit.dev/docs/actions/#fix-spec-file

Rename cirrus task: `Test build RPM` to
`Test build podman-next Copr RPM` for clarity.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-08-26 11:15:37 -04:00
0c028cd9d1 Merge pull request #15477 from flouthoc/remote-build-idmappings
remote,API: fix implementation of build with `--userns=auto` for API and remote use-cases.
2022-08-26 10:27:27 -04:00
61d842a183 Fix template name inconsistency
Signed-off-by: Stefano Figura <stefano@figura.im>
2022-08-26 15:34:05 +02:00
03e51a058d Merge pull request #15486 from dfr/freebsd-syslog
cmd/podman: Enable --syslog on FreeBSD
2022-08-26 08:51:55 -04:00
39d809d3ca Bump github.com/vbauerster/mpb/v7 from 7.4.2 to 7.5.2
Bumps [github.com/vbauerster/mpb/v7](https://github.com/vbauerster/mpb) from 7.4.2 to 7.5.2.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v7.4.2...v7.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-26 12:16:50 +00:00
e00272cd99 remote: fix implementation of build with --userns=auto for API
`podman-remote` and Libpod API does not supports build with
`--userns=auto` since `IDMappingOptions` were not implemented for API
and bindings, following PR implements passing `IDMappingOptions` via
bindings to API.

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-26 16:53:40 +05:30
15aeccb834 libpod: UpdateContainerStatus: do not wait for container
Commit 30e7cbccc194 accidentally added a deadlock as Podman was waiting
for the exit code to show up when the container transitioned to stopped.
Code paths that require the exit code to be written (by the cleanup
process) should already be using `(*Container).Wait()` in a deadlock
free way.

[NO NEW TESTS NEEDED] as I did not manage to a reproducer that would
work in CI.  Ultimately, it's a race condition.

Fixes: #15492
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-08-26 12:39:43 +02:00
b1247b62bd Merge pull request #15482 from edsantiago/docs_dedup_systemd
Man pages: refactor common options: --systemd
2022-08-26 06:33:35 -04:00
d307d1aba4 Merge pull request #15474 from umohnani8/gen-kube
Remove duplicate annotations in generated service yaml
2022-08-26 05:25:21 -04:00