Skip to content

Commit 9031018

Browse files
feat: move cleanup in separate report steps (#1973) (#1974)
Signed-off-by: Charles-Edouard Brétéché <[email protected]> Co-authored-by: Charles-Edouard Brétéché <[email protected]>
1 parent 6a74f27 commit 9031018

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/runner/processors/step.go

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package processors
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"net/url"
78
"path/filepath"
89
"time"
@@ -116,6 +117,14 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
116117
cleaner := cleaner.New(p.timeouts.Cleanup.Duration, p.delayBeforeCleanup, p.deletionPropagationPolicy)
117118
t.Cleanup(func() {
118119
if !cleaner.Empty() || len(p.step.Cleanup) != 0 {
120+
report := &model.StepReport{
121+
Name: fmt.Sprintf("clenaup (%s)", report.Name),
122+
StartTime: time.Now(),
123+
}
124+
defer func() {
125+
report.EndTime = time.Now()
126+
p.report.Add(report)
127+
}()
119128
logger.Log(logging.Cleanup, logging.BeginStatus, color.BoldFgCyan)
120129
defer func() {
121130
logger.Log(logging.Cleanup, logging.EndStatus, color.BoldFgCyan)

0 commit comments

Comments
 (0)