summaryrefslogtreecommitdiff
path: root/libpod
Commit message (Collapse)AuthorAge
...
| * | libpod: Move platform-specific bind mounts to a per-platform methodDoug Rabson2022-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new per-platform method makePlatformBindMounts and moves the /etc/hostname mount. This file is only needed on Linux. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
| * | libpod: Avoid a nil dereference when generating resolv.conf on FreeBSDDoug Rabson2022-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | The code which generates resolv.conf dereferenced c.config.Spec.Linux and this field is not set for FreeBSD containers. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
* | | set default EventsLogFilePath on first runPaul Holzinger2022-09-12
| | | | | | | | | | | | | | | | | | | | | | | | The current code only sets EventsLogFilePath when the tmp is overwritten from the db. We should always set the default when no path was set in containers.conf. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | libpod: runtime newEventer() cleanupPaul Holzinger2022-09-12
| | | | | | | | | | | | | | | | | | | | | There is no reason to create a new eventer every time. The libpod runtime already has one attached which should be used instead. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | event backend journald: fix problem with empty journalPaul Holzinger2022-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently podman events will just fail with `Error: failed to get journal cursor: failed to get cursor: cannot assign requested address` when the journal contains zero podman events. The problem is that we are using the journal accessors wrong. There is no need to call GetCursor() and compare them manually. The Next() return an integer which tells if it moved to the next or not. This means the we can remove GetCursor() which would fail when there is no entry. This also includes another bug fix. Previously the logic called Next() twice for the first entry which caused us to miss the first entry. To reproduce this issue you can run the following commands: ``` sudo journalctl --rotate sudo journalctl --vacuum-time=1s ``` Note that this will delete the full journal. Now run podman events and it fails but with this patch it works. Now generate a single event, i.e. podman pull alpine, and run podman events --until 1s. I am not sure how to get a reliable test into CI, I really do not want to delete the journal and developer or CI systems. Fixes second part of #15688 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | event backend none: return an error when reading eventsPaul Holzinger2022-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | podman --events-backend none events should return with an error since it will never be able to actually list events. Fixes part three of #15688 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | fix hang with podman events file loggerPaul Holzinger2022-09-12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | podman --events-backend file events --stream=false should never hang. The problem is that our tail library will wait for the file to be created which makes sense when we do not run with --stream=false. To fix this we can just always create the file when the logger is initialized. This would also help to report errors early on in case the file is not accessible. Fixes part one from #15688 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | Merge pull request #15511 from rhatdan/codespellOpenShift Merge Robot2022-09-12
|\ \ | |/ |/| Fix stutters
| * Fix stuttersDaniel J Walsh2022-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #15737 from Juneezee/refactor/os.ReadDirOpenShift Merge Robot2022-09-12
|\ \ | | | | | | refactor: use `os.ReadDir` for lightweight directory reading
| * | refactor: use `os.ReadDir` for lightweight directory readingEng Zer Jun2022-09-11
| |/ | | | | | | | | | | | | | | `os.ReadDir` was added in Go 1.16 as part of the deprecation of `ioutil` package. It is a more efficient implementation than `ioutil.ReadDir`. Reference: https://pkg.go.dev/io/ioutil#ReadDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* | Merge pull request #15734 from KenMacD/add-pathOpenShift Merge Robot2022-09-12
|\ \ | |/ |/| Include PATH in conmon env.
| * Include more environment variables in conmon env.Kenny MacDermid2022-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include the path and helper binary dir so that the podman environment more closely matches when conmon calls it as an exit command. Also match the CONTAINERS_CONF lookup to the codestyle of other environment lookups. [NO NEW TESTS NEEDED] Resolves #15707 Signed-off-by: Kenny MacDermid <kenny@macdermid.ca>
* | Merge pull request #15716 from vrothberg/fix-15661OpenShift Merge Robot2022-09-09
|\ \ | | | | | | stop: fix error handling
| * | stop: fix error handlingValentin Rothberg2022-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the error handling in the fallback logic of `stop` when Podman resorts to killing a container; the error message wrapped the wrong error. [NO NEW TESTS NEEDED] as it is a rare flake in the tests and I do not know how to reliably reproduce it. Fixes: #15661 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | | Merge pull request #15687 from vrothberg/RUN-1639OpenShift Merge Robot2022-09-09
|\ \ \ | | | | | | | | health check: add on-failure actions
| * | | health check: add on-failure actionsValentin Rothberg2022-09-09
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For systems that have extreme robustness requirements (edge devices, particularly those in difficult to access environments), it is important that applications continue running in all circumstances. When the application fails, Podman must restart it automatically to provide this robustness. Otherwise, these devices may require customer IT to physically gain access to restart, which can be prohibitively difficult. Add a new `--on-failure` flag that supports four actions: - **none**: Take no action. - **kill**: Kill the container. - **restart**: Restart the container. Do not combine the `restart` action with the `--restart` flag. When running inside of a systemd unit, consider using the `kill` or `stop` action instead to make use of systemd's restart policy. - **stop**: Stop the container. To remain backwards compatible, **none** is the default action. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* / / generate, kube: plug HostUsersGiuseppe Scrivano2022-09-08
|/ / | | | | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* | Merge pull request #15607 from fpoirotte/mainOpenShift Merge Robot2022-09-08
|\ \ | | | | | | Fix #15243 Set AutomountServiceAccountToken to false
| * | Fix #15243 Set AutomountServiceAccountToken to falseFrançois Poirotte2022-09-04
| | | | | | | | | | | | | | | | | | | | | 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>
* | | 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>