summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-01 12:37:10 +0000
committerGitHub <noreply@github.com>2022-07-01 12:37:10 +0000
commit21cd3b2ed270c7396157c4a85457842804d29a00 (patch)
treeea321dccb7ca3b697154e10ba4754cc445126a14 /pkg
parent7688c5ac63ae33e3caa7fe00b122f95bf60abdd5 (diff)
parentd6678adc92b77db13db557a0381beff1c7da8549 (diff)
downloadpodman-21cd3b2ed270c7396157c4a85457842804d29a00.tar.gz
podman-21cd3b2ed270c7396157c4a85457842804d29a00.tar.bz2
podman-21cd3b2ed270c7396157c4a85457842804d29a00.zip
Merge pull request #14798 from flouthoc/overlay-mount-path-abs
overlay,mount: convert source to absolute path for `overlay` mounts of paths
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/volumes.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/specgen/volumes.go b/pkg/specgen/volumes.go
index f272a5c11..5e1ea9a78 100644
--- a/pkg/specgen/volumes.go
+++ b/pkg/specgen/volumes.go
@@ -139,7 +139,13 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na
// This is a overlay volume
newOverlayVol := new(OverlayVolume)
newOverlayVol.Destination = dest
- newOverlayVol.Source = src
+ // convert src to absolute path so we don't end up passing
+ // relative values as lowerdir for overlay mounts
+ source, err := filepath.Abs(src)
+ if err != nil {
+ return nil, nil, nil, errors.Wrapf(err, "failed while resolving absolute path for source %v for overlay mount", src)
+ }
+ newOverlayVol.Source = source
newOverlayVol.Options = options
if _, ok := overlayVolumes[newOverlayVol.Destination]; ok {