mirror of https://github.com/containers/podman.git
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> |
||
---|---|---|
.. | ||
kube | ||
config_common.go | ||
config_common_test.go | ||
config_freebsd.go | ||
config_linux.go | ||
config_linux_cgo.go | ||
config_linux_nocgo.go | ||
config_linux_test.go | ||
container.go | ||
container_create.go | ||
namespaces.go | ||
namespaces_freebsd.go | ||
namespaces_linux.go | ||
namespaces_unsupported.go | ||
oci.go | ||
oci_freebsd.go | ||
oci_linux.go | ||
oci_unsupported.go | ||
pause_image.go | ||
pod_create.go | ||
pod_create_test.go | ||
ports.go | ||
ports_bench_test.go | ||
ports_test.go | ||
security_freebsd.go | ||
security_linux.go | ||
security_unsupported.go | ||
storage.go | ||
validate.go |