mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-12 11:55:42 +00:00
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> |
||
|---|---|---|
| .. | ||
| generate | ||
| config_unsupported.go | ||
| container_validate.go | ||
| namespaces.go | ||
| namespaces_test.go | ||
| pod_validate.go | ||
| podspecgen.go | ||
| resources_freebsd.go | ||
| resources_linux.go | ||
| specgen.go | ||
| specgen_test.go | ||
| utils.go | ||
| utils_linux.go | ||
| volumes.go | ||
| winpath.go | ||
| winpath_linux.go | ||
| winpath_unsupported.go | ||
| winpath_windows.go | ||