@@ -32,7 +32,6 @@ import (
32
32
"github.com/kyverno/chainsaw/pkg/runner/timeout"
33
33
"github.com/kyverno/chainsaw/pkg/testing"
34
34
"github.com/kyverno/pkg/ext/output/color"
35
- "go.uber.org/multierr"
36
35
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
37
36
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
38
37
)
@@ -118,7 +117,7 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
118
117
t .Cleanup (func () {
119
118
if ! cleaner .Empty () || len (p .step .Cleanup ) != 0 {
120
119
report := & model.StepReport {
121
- Name : fmt .Sprintf ("clenaup (%s)" , report .Name ),
120
+ Name : fmt .Sprintf ("cleanup (%s)" , report .Name ),
122
121
StartTime : time .Now (),
123
122
}
124
123
defer func () {
@@ -130,20 +129,12 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
130
129
logger .Log (logging .Cleanup , logging .EndStatus , color .BoldFgCyan )
131
130
}()
132
131
if ! cleaner .Empty () {
133
- cleanupReport := & model.OperationReport {
134
- Name : "cleanup" ,
135
- Type : model .OperationTypeDelete ,
136
- StartTime : time .Now (),
137
- }
138
- if errs := cleaner .Run (ctx ); len (errs ) != 0 {
132
+ if errs := cleaner .Run (ctx , report ); len (errs ) != 0 {
139
133
for _ , err := range errs {
140
134
logging .Log (ctx , logging .Cleanup , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
141
135
}
142
136
failer .Fail (ctx )
143
- cleanupReport .Err = multierr .Combine (errs ... )
144
137
}
145
- cleanupReport .EndTime = time .Now ()
146
- report .Add (cleanupReport )
147
138
}
148
139
for i , operation := range p .step .Cleanup {
149
140
operations , err := p .finallyOperation (i , namespacer , tc .Bindings (), operation )
0 commit comments