Skip to content

Commit

Permalink
Remove os.exit in Run (kube-burner#704)
Browse files Browse the repository at this point in the history
kube-burner-ocp workloads are using workload helpers for Run command.
However this Run() has os.exit(), which is blocking kube-burner-ocp to
run any PostRun() commands.

As we removed os.exit() here, kube-burner-ocp workloads explicitly need
to define PostRun() with os.exit().

kube-burner-ocp PR
kube-burner/kube-burner-ocp#115 which adds
PostRun() in all workloads

Signed-off-by: venkataanil <[email protected]>
  • Loading branch information
venkataanil authored Oct 1, 2024
1 parent ead45c5 commit 3a46b55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/workloads/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewWorkloadHelper(config Config, embedConfig embed.FS, kubeClientProvider *
return wh
}

func (wh *WorkloadHelper) Run(workload string) {
func (wh *WorkloadHelper) Run(workload string) int {
var f io.Reader
var rc int
var err error
Expand Down Expand Up @@ -88,8 +88,8 @@ func (wh *WorkloadHelper) Run(workload string) {
if err != nil {
log.Error(err.Error())
}
log.Info("👋 Exiting kube-burner ", wh.UUID)
os.Exit(rc)
log.Infof("👋 kube-burner run completed with rc %d for UUID %s", rc, wh.UUID)
return rc
}

// ExtractWorkload extracts the given workload and metrics profile to the current directory
Expand Down

0 comments on commit 3a46b55

Please sign in to comment.