mirror of
https://github.com/helm/helm.git
synced 2026-04-15 21:59:50 -04:00
fix(helm): fix GetPodLogs, the hooks should be sorted before get the logs of each hook
Signed-off-by: lubingtan <lubingtan@126.com>
This commit is contained in:
parent
b2b2145388
commit
4e5e68d55c
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Reference in a new issue