Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
Fix start timestamp (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed Jun 10, 2019
1 parent 396fb2f commit 6d689cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controller.v1/pytorch/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func (pc *PyTorchController) updateStatusSingle(job *pyv1.PyTorchJob, rtype pyv1

pylogger.LoggerForJob(job).Infof("PyTorchJob=%s, ReplicaType=%s expected=%d, running=%d, failed=%d",
job.Name, rtype, expected, running, failed)
// All workers are running, set StartTime.
if running == replicas && job.Status.StartTime == nil {
// Set StartTime.
if job.Status.StartTime == nil {
now := metav1.Now()
job.Status.StartTime = &now
// enqueue a sync to check if job past ActiveDeadlineSeconds
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller.v1beta2/pytorch/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func (pc *PyTorchController) updateStatusSingle(job *v1beta2.PyTorchJob, rtype v

pylogger.LoggerForJob(job).Infof("PyTorchJob=%s, ReplicaType=%s expected=%d, running=%d, failed=%d",
job.Name, rtype, expected, running, failed)
// All workers are running, set StartTime.
if running == replicas && job.Status.StartTime == nil {
// Set StartTime.
if job.Status.StartTime == nil {
now := metav1.Now()
job.Status.StartTime = &now
// enqueue a sync to check if job past ActiveDeadlineSeconds
Expand Down

0 comments on commit 6d689cb

Please sign in to comment.