Skip to content

Commit

Permalink
Merge pull request #1252 from tejal29/fix_double_save
Browse files Browse the repository at this point in the history
remove duplicates save for the same dir
  • Loading branch information
tejal29 authored May 8, 2020
2 parents 1018bab + c71deae commit f5e2357
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,16 @@ func filesToSave(deps []string) ([]string, error) {
srcFiles = append(srcFiles, f)
}
}
return srcFiles, nil
// remove duplicates
deduped := []string{}
m := map[string]struct{}{}
for _, f := range srcFiles {
if _, ok := m[f]; !ok {
deduped = append(deduped, f)
m[f] = struct{}{}
}
}
return deduped, nil
}

func fetchExtraStages(stages []config.KanikoStage, opts *config.KanikoOptions) error {
Expand Down

0 comments on commit f5e2357

Please sign in to comment.