Skip to content

Commit

Permalink
Set worker 0 completed if pod's phase goto succeeded (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScorpioCPH authored and k8s-ci-robot committed Jul 16, 2019
1 parent 21b0f38 commit 4ee67e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/controller.v1/tensorflow/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (tc *TFController) reconcilePods(
}

// Check whether worker 0 is exited without error.
if rtype == tfv1.TFReplicaTypeWorker && index == 0 && exitCode == 0 {
if rtype == tfv1.TFReplicaTypeWorker && index == 0 &&
exitCode == 0 && pod.Status.Phase == v1.PodSucceeded {
worker0Completed = true
}
updateTFJobReplicaStatuses(tfjob, rtype, pod)
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller.v1beta2/tensorflow/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func (tc *TFController) reconcilePods(
}

// Check whether worker 0 is exited without error.
if rtype == tfv1beta2.TFReplicaTypeWorker && index == 0 && exitCode == 0 {
if rtype == tfv1beta2.TFReplicaTypeWorker && index == 0 &&
exitCode == 0 && pod.Status.Phase == v1.PodSucceeded {
worker0Completed = true
}
updateTFJobReplicaStatuses(tfjob, rtype, pod)
Expand Down

0 comments on commit 4ee67e2

Please sign in to comment.