Merge pull request #19406 from rhatdan/volumes

Fix up man page and add test on globs
This commit is contained in:
OpenShift Merge Robot authored and GitHub committed 2023-08-02 13:44:34 +02:00
commit cd5ce63724
2 files changed
+16 -1

No files matched your search

+8 -1
View File
@@ -32,7 +32,14 @@ Current supported mount TYPEs are **bind**, **devpts**, **glob**, **image**, **t
· dst, destination, target: mount destination spec.
Paths matching globs, are mounted on the destination directory with the identical name inside the container.
When source globs are specified without the destination directory,
the files and directories are mounted with their complete path
within the container. When the destination is specified, the
files and directories matching the glob on the base file name
on the destination directory are mounted. The option
`type=glob,src=/foo*,destination=/tmp/bar` tells container engines
to mount host files matching /foo* to the /tmp/bar/
directory in the container.
Options specific to volume:
+8
View File
@@ -284,6 +284,14 @@ EOF
run_podman 125 run --rm --mount source=${PODMAN_TMPDIR}/v2\*,destination=/tmp/foobar, ro=false $IMAGE touch $vol2
is "$output" "Error: invalid reference format" "Default mounts don not support globs"
mkdir $PODMAN_TMPDIR/foo1 $PODMAN_TMPDIR/foo2 $PODMAN_TMPDIR/foo3
touch $PODMAN_TMPDIR/foo1/bar $PODMAN_TMPDIR/foo2/bar $PODMAN_TMPDIR/foo3/bar
touch $PODMAN_TMPDIR/foo1/bar1 $PODMAN_TMPDIR/foo2/bar2 $PODMAN_TMPDIR/foo3/bar3
run_podman 125 run --rm --mount type=glob,source=${PODMAN_TMPDIR}/foo?/bar,destination=/tmp $IMAGE ls -l /tmp
is "$output" "Error: /tmp/bar: duplicate mount destination" "Should report conflict on destination directory"
run_podman run --rm --mount type=glob,source=${PODMAN_TMPDIR}/foo?/bar?,destination=/tmp,ro $IMAGE ls /tmp
is "$output" "bar1.*bar2.*bar3" "Should match multiple source files on single destination directory"
}
# vim: filetype=sh