Skip to content

Commit

Permalink
set completion time on success (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
u2takey authored and gaocegege committed Apr 24, 2018
1 parent 33bc774 commit 60d25c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controller.v2/controller_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func (tc *TFJobController) reconcilePods(
// All workers are succeeded, leave a succeeded condition.
if expected == 0 && rtype == tfv1alpha2.TFReplicaTypeWorker {
msg := fmt.Sprintf("TFJob %s is successfully completed.", tfjob.Name)
now := metav1.Now()
tfjob.Status.CompletionTime = &now
err := tc.updateTFJobConditions(tfjob, tfv1alpha2.TFJobSucceeded, tfJobSucceededReason, msg)
if err != nil {
loggerForTFJob(tfjob).Infof("Append tfjob condition error: %v", err)
Expand Down

0 comments on commit 60d25c4

Please sign in to comment.