From ca2390a181bdfa3d9a5d03014e016d04a1209f2f Mon Sep 17 00:00:00 2001 From: Lyndon Shi Date: Fri, 13 Oct 2023 23:18:43 -0700 Subject: [PATCH] update comment Signed-off-by: Lyndon Shi --- pkg/action/hooks.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/action/hooks.go b/pkg/action/hooks.go index aa12c5737..032ed3692 100644 --- a/pkg/action/hooks.go +++ b/pkg/action/hooks.go @@ -39,8 +39,9 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent, } } - // hooke are pre-ordered by kind, so keep order stable - sort.Stable(hookByWeight(executingHooks)) + // Since we want to sort by name among hooks of the same kind, we need to re-sort and can't use + // Stable() and rely on the existing sort by kind. + sort.Sort(hookByWeight(executingHooks)) for _, h := range executingHooks { // Set default delete policy to before-hook-creation