Skip to content

Commit

Permalink
Merge pull request #97 from rohitsakala/master
Browse files Browse the repository at this point in the history
Make sure tags are printed in one order while creating regsync config…
  • Loading branch information
rohitsakala authored May 3, 2023
2 parents 290ac61 + acf23d3 commit aa49bb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/regsync/generateconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ sync:`)
fmt.Fprintln(file, " tags:")
fmt.Fprintln(file, " allow:")

for _, imageTag := range imageTagMap[repo] {
fmt.Fprintf(file, " - %s\n", imageTag)
// We collect all tags and then sort them so there is consistency
// in the update of the regsync file always.
tags := make([]string, 0)
tags = append(tags, imageTagMap[repo]...)
sort.Strings(tags)

for _, tag := range tags {
fmt.Fprintf(file, " - %s\n", tag)
}
}

Expand Down

0 comments on commit aa49bb9

Please sign in to comment.