summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-19 05:01:52 -0400
committerGitHub <noreply@github.com>2021-04-19 05:01:52 -0400
commit21ae0730344b8510a1af2045aceebaa1a7a38f4c (patch)
tree21431c4730510587ae0932501db8049e52f5cb8a /pkg
parent6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87 (diff)
parent18d462c41bfa0d06353427d1abe2f60f0724d28d (diff)
downloadpodman-21ae0730344b8510a1af2045aceebaa1a7a38f4c.tar.gz
podman-21ae0730344b8510a1af2045aceebaa1a7a38f4c.tar.bz2
podman-21ae0730344b8510a1af2045aceebaa1a7a38f4c.zip
Merge pull request #10069 from EduardoVega/clean-mounts-9618
Ensure mount destination is clean, no trailing slash
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/storage.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/specgen/generate/storage.go b/pkg/specgen/generate/storage.go
index e135f4728..8066834f7 100644
--- a/pkg/specgen/generate/storage.go
+++ b/pkg/specgen/generate/storage.go
@@ -57,10 +57,13 @@ func finalizeMounts(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Ru
}
for _, m := range s.Mounts {
- if _, ok := unifiedMounts[m.Destination]; ok {
- return nil, nil, nil, errors.Wrapf(errDuplicateDest, "conflict in specified mounts - multiple mounts at %q", m.Destination)
+ // Ensure that mount dest is clean, so that it can be
+ // compared against named volumes and avoid duplicate mounts.
+ cleanDestination := filepath.Clean(m.Destination)
+ if _, ok := unifiedMounts[cleanDestination]; ok {
+ return nil, nil, nil, errors.Wrapf(errDuplicateDest, "conflict in specified mounts - multiple mounts at %q", cleanDestination)
}
- unifiedMounts[m.Destination] = m
+ unifiedMounts[cleanDestination] = m
}
for _, m := range commonMounts {