Skip to content

Commit

Permalink
fix(utils): wait a second for new job to be created before fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed May 7, 2024
1 parent e889031 commit 7a1501a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/dashboard/generated/bindata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/resource/utils/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func RunJob(ctx context.Context, c client.Client, logger *logr.Logger, namespace
return "", int32(cmdconst.ExitCodeNotExecuted), errors.Wrapf(err, "failed to create job of image: %s", image)
}

// Wait for the job to be created before fetching it
time.Sleep(time.Second)

var jobObject *batchv1.Job
for i := 0; i < obcfg.GetConfig().Time.CheckJobMaxRetries; i++ {
jobObject, err = GetJob(ctx, c, namespace, fullJobName)
Expand Down

0 comments on commit 7a1501a

Please sign in to comment.