Skip to content

Commit

Permalink
log the error before return
Browse files Browse the repository at this point in the history
log the error before return
  • Loading branch information
jiuker committed Jul 26, 2024
1 parent 54be9cb commit 9e7cc2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controller/job-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func (c *JobController) SyncHandler(key string) (Result, error) {
if err != nil {
jobCR.Status.Phase = miniojob.MinioJobPhaseError
jobCR.Status.Message = fmt.Sprintf("Get tenant %s/%s error:%v", jobCR.Spec.TenantRef.Namespace, jobCR.Spec.TenantRef.Name, err)
klog.Errorln(jobCR.Status.Message)
err = c.updateJobStatus(ctx, &jobCR)
return WrapResult(Result{}, err)
}
Expand Down Expand Up @@ -264,6 +265,7 @@ func (c *JobController) SyncHandler(key string) (Result, error) {
if err != nil {
jobCR.Status.Phase = miniojob.MinioJobPhaseError
jobCR.Status.Message = fmt.Sprintf("Create job error:%v", err)
klog.Errorln(jobCR.Status.Message)
err = c.updateJobStatus(ctx, &jobCR)
return WrapResult(Result{}, err)
}
Expand Down

0 comments on commit 9e7cc2f

Please sign in to comment.