diff --git a/executor/oci/mounts.go b/executor/oci/mounts.go index 6f4d1367..a92e85ad 100644 --- a/executor/oci/mounts.go +++ b/executor/oci/mounts.go @@ -104,11 +104,11 @@ func withBoundProc() oci.SpecOpts { func dedupMounts(mnts []specs.Mount) []specs.Mount { ret := make([]specs.Mount, 0, len(mnts)) visited := make(map[string]int) - for i, mnt := range mnts { + for _, mnt := range mnts { if j, ok := visited[mnt.Destination]; ok { ret[j] = mnt } else { - visited[mnt.Destination] = i + visited[mnt.Destination] = len(ret) ret = append(ret, mnt) } }