podman/pkg/specgen/generate
Matthew Heon 2de22ebf0d Ensure volumes-from mounts override image volumes
We do not allow volumes and mounts to be placed at the same
location in the container, with create-time checks to ensure this
does not happen. User-added conflicts cannot be resolved (if the
user adds two separate mounts to, say, /myapp, we can't resolve
that contradiction and error), but for many other volume sources,
we can solve the contradiction ourselves via a priority
hierarchy. Image volumes come first, and are overridden by the
`--volumes-from` flag, which are overridden by user-added mounts,
etc, etc. The problem here is that we were not properly handling
volumes-from overriding image volumes. An inherited volume from
--volumes-from would supercede an image volume, but an inherited
mount would not. Solution is fortunately simple - just clear out
the map entry for the other type when adding volumes-from
volumes.

Makes me wish for Rust sum types - conflict resolution would be a
lot simpler if we could use a sum type for volumes and bind
mounts and thus have a single map instead of two maps, one for
each type.

Fixes #19529

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-08-07 15:04:33 -04:00
..
kube Add missing reserved annotation support to `play` 2023-07-17 14:06:23 -04:00
config_common.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
config_common_test.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
config_freebsd.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
config_linux.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
config_linux_cgo.go Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
config_linux_nocgo.go go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
config_linux_test.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
container.go Check tty flag to set default terminal in Env 2023-08-03 12:29:21 +01:00
container_create.go make /dev & /dev/shm read/only when --read-only --read-only-tmpfs=false 2023-07-30 06:09:30 -04:00
namespaces.go rootless: use default_rootless_network_cmd config 2023-06-29 09:46:25 +02:00
namespaces_freebsd.go Fix stutters 2022-09-10 07:52:00 -04:00
namespaces_linux.go Stop recording annotations set to false 2022-12-19 16:07:33 -05:00
namespaces_unsupported.go specgen/generate: Add support for FreeBSD 2022-08-30 11:24:57 +01:00
oci.go set max ulimits for rootless on each start 2023-05-31 09:20:31 +00:00
oci_freebsd.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
oci_linux.go make /dev & /dev/shm read/only when --read-only --read-only-tmpfs=false 2023-07-30 06:09:30 -04:00
oci_unsupported.go specgen/generate: Add support for FreeBSD 2022-08-30 11:24:57 +01:00
pause_image.go Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
pod_create.go Pods now return what containers were removed with them 2023-06-01 16:24:59 -04:00
pod_create_test.go Allow namespace path network option for pods. 2022-11-04 11:26:06 +01:00
ports.go Fixes port collision issue on use of --publish-all 2023-01-30 14:52:57 -07:00
ports_bench_test.go fix a number of errcheck issues 2022-03-22 13:15:28 +01:00
ports_test.go bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
security_freebsd.go pkg/specgen: Add device support for FreeBSD 2023-08-04 10:11:14 +01:00
security_linux.go source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
security_unsupported.go specgen/generate: Add support for FreeBSD 2022-08-30 11:24:57 +01:00
storage.go Ensure volumes-from mounts override image volumes 2023-08-07 15:04:33 -04:00
validate.go Do not display the resource limits warning message 2023-04-11 19:30:59 +09:00