diff --git a/internal/release/v2/util/kind_sorter.go b/internal/release/v2/util/kind_sorter.go index 000fbf1b6..c7912f7f9 100644 --- a/internal/release/v2/util/kind_sorter.go +++ b/internal/release/v2/util/kind_sorter.go @@ -144,16 +144,15 @@ func sortManifestsByKind(manifests []Manifest, ordering KindSortOrder) []Manifes func sortHooksByKind(hooks []*release.Hook, ordering KindSortOrder) []*release.Hook { orderMap := buildKindOrderMap(ordering) - h := hooks - sort.SliceStable(h, func(i, j int) bool { + sort.SliceStable(hooks, func(i, j int) bool { return lessByKind( - h[i].Kind, - h[j].Kind, + hooks[i].Kind, + hooks[j].Kind, orderMap, ) }) - return h + return hooks } func lessByKind( diff --git a/pkg/release/v1/util/kind_sorter.go b/pkg/release/v1/util/kind_sorter.go index ae8dae76a..427ee22c4 100644 --- a/pkg/release/v1/util/kind_sorter.go +++ b/pkg/release/v1/util/kind_sorter.go @@ -145,16 +145,15 @@ func sortManifestsByKind(manifests []Manifest, ordering KindSortOrder) []Manifes func sortHooksByKind(hooks []*release.Hook, ordering KindSortOrder) []*release.Hook { orderMap := buildKindOrderMap(ordering) - h := hooks - sort.SliceStable(h, func(i, j int) bool { + sort.SliceStable(hooks, func(i, j int) bool { return lessByKind( - h[i].Kind, - h[j].Kind, + hooks[i].Kind, + hooks[j].Kind, orderMap, ) }) - return h + return hooks } func lessByKind(kindA string, kindB string, ordering map[string]int) bool {