Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

stage1: improve duplicate mount-volume detection #3666

Merged
merged 4 commits into from
May 8, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
stage0: deduplicate mounts based on clean path
  • Loading branch information
lucab committed May 5, 2017
commit fddc4d27f2eceb036202450aeda7624a0de6694a
5 changes: 3 additions & 2 deletions stage0/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ func deduplicateMPs(mounts []schema.Mount) []schema.Mount {
var res []schema.Mount
seen := make(map[string]struct{})
for _, m := range mounts {
if _, ok := seen[m.Path]; !ok {
cleanPath := path.Clean(m.Path)
if _, ok := seen[cleanPath]; !ok {
res = append(res, m)
seen[m.Path] = struct{}{}
seen[cleanPath] = struct{}{}
}
}
return res
Expand Down