release: clarify order map naming

Signed-off-by: Raushan Kumar <raus7n@gmail.com>
pull/32386/head
Raushan Kumar 3 months ago
parent db8da0a937
commit ca5ca56275

@ -158,10 +158,10 @@ func sortHooksByKind(hooks []*release.Hook, ordering KindSortOrder) []*release.H
func lessByKind( func lessByKind(
kindA string, kindA string,
kindB string, kindB string,
ordering map[string]int, orderMap map[string]int,
) bool { ) bool {
first, aok := ordering[kindA] first, aok := orderMap[kindA]
second, bok := ordering[kindB] second, bok := orderMap[kindB]
if !aok && !bok { if !aok && !bok {
// if both are unknown then sort alphabetically by kind, keep original order if same kind // if both are unknown then sort alphabetically by kind, keep original order if same kind

@ -156,9 +156,13 @@ func sortHooksByKind(hooks []*release.Hook, ordering KindSortOrder) []*release.H
return hooks return hooks
} }
func lessByKind(kindA string, kindB string, ordering map[string]int) bool { func lessByKind(
first, aok := ordering[kindA] kindA string,
second, bok := ordering[kindB] kindB string,
orderMap map[string]int,
) bool {
first, aok := orderMap[kindA]
second, bok := orderMap[kindB]
if !aok && !bok { if !aok && !bok {
// if both are unknown then sort alphabetically by kind, keep original order if same kind // if both are unknown then sort alphabetically by kind, keep original order if same kind

Loading…
Cancel
Save