summaryrefslogtreecommitdiff
path: root/libpod
Commit message (Collapse)AuthorAge
* Merge pull request #15668 from giuseppe/skip-sys-fs-cgroup-systemd-if-missingOpenShift Merge Robot2022-09-07
|\ | | | | podman: skip /sys/fs/cgroup/systemd if not present
| * podman: skip /sys/fs/cgroup/systemd if not presentGiuseppe Scrivano2022-09-07
| | | | | | | | | | | | | | | | | | | | | | skip adding the /sys/fs/cgroup/systemd bind mount if it is not already present on the host. [NO NEW TESTS NEEDED] requires a system without systemd. Closes: https://github.com/containers/podman/issues/15647 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | Merge pull request #15649 from dfr/freebsd-conmonOpenShift Merge Robot2022-09-07
|\ \ | | | | | | Fixes for conmon support on FreeBSD
| * | libpod: Filter out ENOTCONN errors when trying to close unix domain socketsDoug Rabson2022-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On FreeBSD, ENOTCONN can be reported if shutdown is called on a unix domain socket where the remote end is already closed. This change ignores those errors instead of printing an error message on container exit. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
| * | libpod: Factor out capabilites code from prepareProcessExecDoug Rabson2022-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the code which sets the process capabilites for the exec to oci_conmon_exec_linux.go since this is a linux-specific feature. Adding a no-op stub for FreeBSD enables 'podman exec' when using the ocijail runtime. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* | | Merge pull request #15633 from thediveo/eventsOpenShift Merge Robot2022-09-07
|\ \ \ | |_|/ |/| | Closes #15617: emit container labels for container exited and exec died events
| * | emit container labels also for container exited and exec died eventsHarald Albrecht2022-09-06
| |/ | | | | | | | | | | | | - adds unit test for container labels on container die event - implements #15617 Signed-off-by: Harald Albrecht <harald.albrecht@gmx.net>
* / fix Pod removal after OS hard shutdownMikhail Khachayants2022-09-06
|/ | | | | | | | | | | | In case of a hard OS shutdown, containers may have a "removing" state after a reboot, and an attempt to remove Pods with such containers is unsuccessful: error freeing lock for container ...: no such file or directory [NO NEW TESTS NEEDED] Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
* libpod: Factor out setting volume atime to container_internal_linux.goDoug Rabson2022-09-05
| | | | | | | | | | | 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>
* libpod: Move miscellaneous file handlling to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Don't mount /dev/shm in containers on FreeBSDDoug Rabson2022-09-05
| | | | | | | | | 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>
* libpod: Factor out handling of slirp4netns and net=noneDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move functions related to /etc bind mounts to ↵Doug Rabson2022-09-05
| | | | | | | | container_internal_common.go [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move getRootNetNsDepCtr to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Use (*Container).addNetworkNamespace to restore checkpoint networkDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move functions related to checkpoints to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move mountNotifySocket to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move getUserOverrides, lookupHostUser to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move isWorkDirSymlink, resolveWorkDir to container_internal_common.goDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Use platform-specific mount type for volume mountsDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Factor out platform-specific sections from generateSpecDoug Rabson2022-09-05
| | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Move getOverlayUpperAndWorkDir and generateSpec to ↵Doug Rabson2022-09-05
| | | | | | | | container_internal_common.go [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* libpod: Add FreeBSD implementation of container internalsDoug Rabson2022-09-05
| | | | | | | | | | 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>
* libpod: Move networkDisable to container_linux.goDoug Rabson2022-09-05
| | | | | | | | | 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>
* Merge pull request #15618 from mheon/add_group_to_addtlgroupsOpenShift Merge Robot2022-09-05
|\ | | | | Add container GID to additional groups
| * Add container GID to additional groupsMatthew Heon2022-09-02
| | | | | | | | | | | | | | Mitigates a potential permissions issue. Mirrors Buildah PR #4200 and CRI-O PR #6159. Signed-off-by: Matthew Heon <mheon@redhat.com>
* | Merge pull request #15582 from dfr/freebsd-bindOpenShift Merge Robot2022-09-04
|\ \ | | | | | | Add support for FreeBSD volume mounts in specgen
| * | libpod/define: Make TypeBind a platform-specific constantDoug Rabson2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | This allows us to redefine to the equivalent nullfs on FreeBSD. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* | | Merge pull request #15581 from dfr/random-namesOpenShift Merge Robot2022-09-02
|\ \ \ | | | | | | | | libpod: Ensure that generated container names are random
| * | | libpod: Ensure that generated container names are randomDoug Rabson2022-09-01
| |/ / | | | | | | | | | | | | | | | Fixes #15569. Signed-off-by: Doug Rabson <dfr@rabson.org>
* | | Merge pull request #15599 from umohnani8/gen-kubeOpenShift Merge Robot2022-09-02
|\ \ \ | |_|/ |/| | Fix bind-mount-option annotation in gen/play kube
| * | Fix bind-mount-option annotation in gen/play kubeUrvashi Mohnani2022-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | implement podman updateCharlie Doern2022-09-01
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15571 from umohnani8/gen-kubeOpenShift Merge Robot2022-09-01
|\ \ | |/ |/| Set enableServiceLinks to false in generated yaml
| * Set enableServiceLinks to false in generated yamlUrvashi Mohnani2022-08-31
| | | | | | | | | | | | | | | | Since podman doesn't set/use the needed service env variable, always set enableServiceLinks to false in the generated kube yaml. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
* | Merge pull request #15566 from mheon/fix_15557OpenShift Merge Robot2022-08-31
|\ \ | |/ |/| Inhibit SIGTERM during Conmon startup
| * Inhibit SIGTERM during Conmon startupMatthew Heon2022-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we get a SIGTERM immediately after Conmon starts but before we record its PID in the database, we end up leaking a Conmon and associated OCI runtime process. Inhibit shutdown using the logic we originally wrote to prevent similar issues during container creation to prevent this problem. [NO NEW TESTS NEEDED] No real way to test this I can think of. Fixes #15557 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | Merge pull request #15473 from umohnani8/empty-dirOpenShift Merge Robot2022-08-31
|\ \ | | | | | | Add emptyDir volume support to kube play
| * | Add emptyDir volume support to kube playUrvashi Mohnani2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | libpod: Make sure writeConmonPipeData is called on FreeBSDDoug Rabson2022-08-29
|/ / | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15516 from kubealex/handle-connected-networkOpenShift Merge Robot2022-08-29
|\ \ | | | | | | Handle an already connected network in libpod API
| * | Fix #15499 already connected networkAlessandro Rossi2022-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge pull request #15494 from vrothberg/fix-15492OpenShift Merge Robot2022-08-26
|\ \ \ | |/ / |/| | libpod: UpdateContainerStatus: do not wait for container
| * | libpod: UpdateContainerStatus: do not wait for containerValentin Rothberg2022-08-26
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #15474 from umohnani8/gen-kubeDaniel J Walsh2022-08-26
|\ \ | | | | | | Remove duplicate annotations in generated service yaml
| * | Remove duplicate annotations in generated service yamlUrvashi Mohnani2022-08-24
| |/ | | | | | | | | | | | | | | | | Don't add the same annotations as the pod yaml to the service yaml as it is not needed. [NO NEW TESTS NEEDED] Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
* / Run codespellDaniel J Walsh2022-08-25
|/ | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #15437 from mheon/default_volume_timeoutOpenShift Merge Robot2022-08-24
|\ | | | | Add support for containers.conf volume timeouts
| * Add support for containers.conf volume timeoutsMatthew Heon2022-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, do a general cleanup of all the timeout code. Changes include: - Convert from int to *uint where possible. Timeouts cannot be negative, hence the uint change; and a timeout of 0 is valid, so we need a new way to detect that the user set a timeout (hence, pointer). - Change name in the database to avoid conflicts between new data type and old one. This will cause timeouts set with 4.2.0 to be lost, but considering nobody is using the feature at present (and the lack of validation means we could have invalid, negative timeouts in the DB) this feels safe. - Ensure volume plugin timeouts can only be used with volumes created using a plugin. Timeouts on the local driver are nonsensical. - Remove the existing test, as it did not use a volume plugin. Write a new test that does. The actual plumbing of the containers.conf timeout in is one line in volume_api.go; the remainder are the above-described cleanups. Signed-off-by: Matthew Heon <mheon@redhat.com>
* | libpod: Enable 'podman info' for FreeBSDDoug Rabson2022-08-24
| | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>