16480 Commits

Author SHA1 Message Date
cbaa78cd8a Fix list of default capabilities
Fixes: https://github.com/containers/podman/issues/15626

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-05 07:25:38 -04:00
a3aecf0f26 libpod: Factor out setting volume atime to container_internal_linux.go
It turns out that field names in syscall.Stat_t are platform-specific.
An alternative to this could change fixVolumePermissions to use
unix.Lstat since unix.Stat_t uses the same mmember name for Atim on both
Linux and FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:20:50 +01:00
7a1abd03c5 libpod: Move miscellaneous file handlling to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:20:50 +01:00
d162285f34 libpod: Don't mount /dev/shm in containers on FreeBSD
This mount has never been standard on FreeBSD, preferring to use /tmp or
/var/tmp optionally with tmpfs to ensure data is lost on a reboot.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:20:50 +01:00
212b11c34c libpod: Factor out handling of slirp4netns and net=none
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:20:50 +01:00
eab4291d99 libpod: Move functions related to /etc bind mounts to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:20:50 +01:00
b3989be768 libpod: Move getRootNetNsDepCtr to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:50 +01:00
a148c16225 libpod: Use (*Container).addNetworkNamespace to restore checkpoint network
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
7518a9136a libpod: Move functions related to checkpoints to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
be5d1261b4 libpod: Move mountNotifySocket to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
71e2074e83 libpod: Move getUserOverrides, lookupHostUser to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
232eea5a00 libpod: Move isWorkDirSymlink, resolveWorkDir to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
a5ee3cb790 pkg/util: Add no-op implementation of AddPrivilegedDevices on FreeBSD
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
0889215d83 libpod: Use platform-specific mount type for volume mounts
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
c1a86a8c4c libpod: Factor out platform-specific sections from generateSpec
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
e101f4350b libpod: Move getOverlayUpperAndWorkDir and generateSpec to container_internal_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:17:49 +01:00
6e4b5b0075 libpod: Add FreeBSD implementation of container internals
This contains a lot of code in common with container_internal_linux.go.
Subsequent commits will move the shared code to
container_internal_common.go to reduce the duplication.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:12:12 +01:00
8ade76e79b libpod: Move networkDisable to container_linux.go
This moves platform-specific details of the network implementation out
of the generic file so that we can add the FreeBSD equivalent.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-05 10:12:12 +01:00
098c0714e5 Merge pull request #15619 from lsm5/fix-copr-rhel-builds
[CI:BUILD] Copr: Define _user_tmpfilesdir for rhel
2022-09-05 00:19:19 +02:00
5c7f283361 Merge pull request #15618 from mheon/add_group_to_addtlgroups
Add container GID to additional groups
2022-09-05 00:16:51 +02:00
b506f6ebb7 Merge pull request #15625 from edsantiago/docs_dedup_label
[CI:DOCS] Man pages: refactor common options: --label
2022-09-05 00:14:10 +02:00
71978b0a0c Fix #15243 Set AutomountServiceAccountToken to false
podman does not use any service account token, so we set the automount flag
to false in podman generate kube.

Signed-off-by: François Poirotte <clicky@erebot.net>
2022-09-04 22:51:56 +02:00
7cc2543433 Merge pull request #15605 from TomSweeneyRedHat/dev/tsweeney/adjusttest
Update test per comment in #15555
2022-09-04 14:24:00 +02:00
8942a60bb0 Merge pull request #15582 from dfr/freebsd-bind
Add support for FreeBSD volume mounts in specgen
2022-09-04 13:34:41 +02:00
b9df3a6a9f Man pages: refactor common options: --label
Went with the podman-run version, where the "example" is
in the option template as per our guidelines.

I could not include the network- or volume-create
man pages, nor podman build.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-03 05:49:52 -06:00
e136bcc7c9 Merge pull request #15606 from edsantiago/docs_dedup_digestfile
[CI:DOCS] Man pages: refactor common options: --digestfile
2022-09-03 13:27:25 +02:00
d82a41687e Add container GID to additional groups
Mitigates a potential permissions issue. Mirrors Buildah PR #4200
and CRI-O PR #6159.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-09-02 15:51:36 -04:00
2a7a6bd9a4 Merge pull request #15581 from dfr/random-names
libpod: Ensure that generated container names are random
2022-09-02 21:00:35 +02:00
9476b78316 Merge pull request #15614 from sstosh/fix-swagger
Fix swagger documentation
2022-09-02 20:15:03 +02:00
c5da5e459a Merge pull request #15599 from umohnani8/gen-kube
Fix bind-mount-option annotation in gen/play kube
2022-09-02 20:12:25 +02:00
3e1dde10b8 [CI:BUILD] Copr: Define _user_tmpfilesdir for rhel
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-09-02 13:47:30 -04:00
0e66f75f2a Merge pull request #15604 from edsantiago/docs_dedup_deviceXY
[CI:DOCS] Man pages: refactor common options: --device-X-Y
2022-09-02 12:57:45 +02:00
4cbc4774f1 Merge pull request #15404 from arixmkii/win_compat2
Improved Windows compatibility for machine command
2022-09-02 12:49:58 +02:00
875fd48580 Fix swagger documentation
* ContainerKillLibpod "signal" query default is SIGKILL.
* ContainerListLibpod "namespace" query is failed to show.
* SecretListLibpod parameters is duplicated.
* SecretList parameters is duplicated.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-09-02 19:21:20 +09:00
9ab6449e36 Merge pull request #15587 from edsantiago/skip_ubuntu_flake
CI: disable flaking test on ubuntu
2022-09-02 00:05:07 +02:00
070dfa3b3b Man pages: refactor common options: --digestfile
Only used in two pages. I took the liberty of adding the "N/A
on remote" text to manifest-push.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 15:45:00 -06:00
3e744e52b5 System tests for podman-update
The e2e tests are incomplete, because they're just too hard
for any human to read/maintain. This defines tests in a
table, so they're easily reviewed and updated. This makes
it very easy to see which options are actually tested and
which are not, under root/rootless cgroups v1/v2.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 15:42:35 -06:00
475cac4432 Merge pull request #15601 from edsantiago/docs_dedup_name
[CI:DOCS] Man pages: refactor common options: --name
2022-09-01 23:41:53 +02:00
c05b6e5d3b Update test per comment in #15555
While backporting a test from main, @edsantiago asked that
the test be adjusted as noted here:
https://github.com/containers/podman/pull/15555#issuecomment-1232791752.

This PR brings those same changes to main for posterity sake.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-09-01 15:55:42 -04:00
3d09d47a25 Man pages: refactor common options: --device-X-Y
Followup from #15276: add the FAQ-26 link, and fix one
broken replacement.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 13:11:44 -06:00
d0d1af338a Merge pull request #15276 from cdoern/update
implement podman update
2022-09-01 20:48:25 +02:00
050f3291b9 implement podman update
podman update allows users to change the cgroup configuration of an existing container using the already defined resource limits flags
from podman create/run. The supported flags in crun are:

this command is also now supported in the libpod api via the /libpod/containers/<CID>/update endpoint where
the resource limits are passed inthe request body and follow the OCI resource spec format

–memory
–cpus
–cpuset-cpus
–cpuset-mems
–memory-swap
–memory-reservation
–cpu-shares
–cpu-quota
–cpu-period
–blkio-weight
–cpu-rt-period
–cpu-rt-runtime
-device-read-bps
-device-write-bps
-device-read-iops
-device-write-iops
-memory-swappiness
-blkio-weight-device

resolves #15067

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-09-01 13:02:01 -04:00
c63830166c Man pages: refactor common options: --name
Only for podman-create and -run, unfortunately: all the
others are too different, and can't easily be combined.

I went with the podman-run version because it was most
recently updated in #5192.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 10:58:00 -06:00
4a1acccf96 Fix bind-mount-option annotation in gen/play kube
The format used for setting the bind-mount-options annotations
in the kube yaml was incorrect and caused k8s to throw an error
when trying to play the generated kube yaml.
Fix the annotation format to match the rules of k8s.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-09-01 11:51:46 -04:00
64eb079415 CI: disable flaking test on ubuntu
See https://github.com/containers/conmon/pull/352

As of a few days ago, Ubuntu still hadn't built a fixed conmon.
Just skip the test until we get a fixed Ubuntu or until we
figure out a better solution to the test-something-RHEL8ish
problem.

UPDATE: WEIRD: this 'skip' triggered a baffling failure
on Ubuntu: the "Kubernetes only allows 63 characters"
warning message stopped appearing, on Ubuntu only, which
then caused the kube-generate tests to fail because they
actually checked for that. The message doesn't appear
because generate-kube is no longer spitting out a line
for org.opencontainers.image.base.digest/CONTAINER.
(Why this line is gone, I don't know, and choose not
to investigate). Solution: stop checking for the kube-63
warning. It's just not that important.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-01 09:27:21 -06:00
0085fbb488 Merge pull request #15571 from umohnani8/gen-kube
Set enableServiceLinks to false in generated yaml
2022-09-01 15:17:39 +02:00
3994eb6985 Merge pull request #15574 from edsantiago/fix_useradd_flake
Cirrus: pick UIDs/GIDs starting at 1500, not 1000
2022-09-01 13:51:15 +02:00
b667d7340c libpod: Ensure that generated container names are random
Fixes #15569.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-01 10:27:04 +01:00
72f4c77139 Merge pull request #15360 from m0duspwnens/api_compat_containers
api: return imageID instead of imageName, for "Image" when Podman api is queried
2022-09-01 10:58:33 +02:00
009afb50b3 Merge pull request #15560 from dfr/freebsd-specgen
Add FreeBSD support for pkg/specgen/generate
2022-09-01 10:47:47 +02:00