fix(helm): fix GetPodLogs, the hooks should be sorted before get the logs of each hook

Signed-off-by: lubingtan <lubingtan@126.com>
pull/12321/head
Bingtan Lu 1 year ago committed by lubingtan
parent b2b2145388
commit 4e5e68d55c

@ -20,6 +20,7 @@ import (
"context"
"fmt"
"io"
"sort"
"time"
"github.com/pkg/errors"
@ -112,7 +113,9 @@ func (r *ReleaseTesting) GetPodLogs(out io.Writer, rel *release.Release) error {
return errors.Wrap(err, "unable to get kubernetes client to fetch pod logs")
}
for _, h := range rel.Hooks {
hooksByWight := append([]*release.Hook{}, rel.Hooks...)
sort.Stable(hookByWeight(hooksByWight))
for _, h := range hooksByWight {
for _, e := range h.Events {
if e == release.HookTest {
if contains(r.Filters[ExcludeNameFilter], h.Name) {

Loading…
Cancel
Save