Skip to content

Commit

Permalink
fix completion time setting bug (#1226)
Browse files Browse the repository at this point in the history
Co-authored-by: shaowei su <[email protected]>
  • Loading branch information
shaowei-su and shaowei su authored Jan 27, 2021
1 parent 169453e commit 5e69262
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller.v1/tensorflow/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func (tc *TFController) UpdateJobStatus(job interface{}, replicas map[commonv1.R
msg := fmt.Sprintf("TFJob %s/%s has failed because %d %s replica(s) failed.",
tfJob.Namespace, tfJob.Name, failed, rtype)
tc.Recorder.Event(tfJob, corev1.EventTypeNormal, tfJobFailedReason, msg)
if tfJob.Status.CompletionTime == nil {
if jobStatus.CompletionTime == nil {
now := metav1.Now()
tfJob.Status.CompletionTime = &now
jobStatus.CompletionTime = &now
}
err := commonutil.UpdateJobConditions(jobStatus,
commonv1.JobFailed, tfJobFailedReason, msg)
Expand Down

0 comments on commit 5e69262

Please sign in to comment.