mirror of
https://github.com/containers/podman.git
synced 2025-12-16 03:57:36 +08:00
pod: fix duplicate volumes from containers.conf
If some volumes are specified in containers.conf, they are currently added twice to the containers spec causing the container to fail: $ head -n2 ~/.config/containers/containers.conf [containers] volumes = ["/tmp:/tmp"] $ podman pod create --name foo 7ac7f97f9b74a596332483e4a13e58cb9c8d997e9c5baae46804ae0acc26cbc6 $ podman run --pod=foo alpine true Error: "/tmp": duplicate mount destination The fix is to ignore the setting from containers.conf when setting the pod default configuration. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -71,6 +71,24 @@ function teardown() {
|
||||
}
|
||||
|
||||
|
||||
@test "podman pod create - custom volumes" {
|
||||
skip_if_remote "CONTAINERS_CONF_OVERRIDE only affects server side"
|
||||
image="i.do/not/exist:image"
|
||||
tmpdir=$PODMAN_TMPDIR/pod-test
|
||||
mkdir -p $tmpdir
|
||||
containersconf=$tmpdir/containers.conf
|
||||
cat >$containersconf <<EOF
|
||||
[containers]
|
||||
volumes = ["/tmp:/foobar"]
|
||||
EOF
|
||||
|
||||
CONTAINERS_CONF_OVERRIDE=$containersconf run_podman pod create
|
||||
podid="$output"
|
||||
|
||||
CONTAINERS_CONF_OVERRIDE=$containersconf run_podman create --pod $podid $IMAGE grep foobar /proc/mounts
|
||||
}
|
||||
|
||||
|
||||
@test "podman pod create - custom infra image" {
|
||||
skip_if_remote "CONTAINERS_CONF_OVERRIDE only affects server side"
|
||||
image="i.do/not/exist:image"
|
||||
|
||||
Reference in New Issue
Block a user