Skip to content

Commit

Permalink
chore(directives): ensure stable order commit msg
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Dec 10, 2024
1 parent e075ca2 commit 6fd1413
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/directives/kustomize_image_setter.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,17 @@ func (k *kustomizeImageSetter) generateCommitMessage(path string, images map[str
}
_, _ = commitMsg.WriteString("\n")

for _, i := range images {
// Sort the images by name, in descending order for consistency.
imageNames := make([]string, 0, len(images))
for name := range images {
imageNames = append(imageNames, name)
}
slices.Sort(imageNames)

// Append each image to the commit message.
for _, name := range imageNames {
i := images[name]

ref := i.Name
if i.NewName != "" {
ref = i.NewName
Expand Down

0 comments on commit 6fd1413

Please sign in to comment.