Skip to content

Commit

Permalink
fix(helm): fix GetPodLogs, the hooks should be sorted before get the …
Browse files Browse the repository at this point in the history
…logs of each hook

Signed-off-by: lubingtan <lubingtan@126.com>
  • Loading branch information
LuBingtan committed Aug 22, 2023
1 parent b2b2145 commit 4e5e68d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/action/release_testing.go
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"io"
"sort"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4e5e68d

Please sign in to comment.