diff --git a/pkg/controller.v1/tensorflow/controller.go b/pkg/controller.v1/tensorflow/controller.go index 56b13dc6ac..828c045fcb 100644 --- a/pkg/controller.v1/tensorflow/controller.go +++ b/pkg/controller.v1/tensorflow/controller.go @@ -514,7 +514,7 @@ func (tc *TFController) pastBackoffLimit(tfjob *tfv1.TFJob, pods []*v1.Pod) (boo } for i := range pods { po := pods[i] - if po.Status.Phase == v1.PodRunning || po.Status.Phase != v1.PodPending { + if po.Status.Phase == v1.PodRunning || po.Status.Phase == v1.PodPending { for j := range po.Status.InitContainerStatuses { stat := po.Status.InitContainerStatuses[j] result += stat.RestartCount diff --git a/pkg/controller.v1beta2/tensorflow/controller.go b/pkg/controller.v1beta2/tensorflow/controller.go index 0085ad4b98..43d1d7e134 100644 --- a/pkg/controller.v1beta2/tensorflow/controller.go +++ b/pkg/controller.v1beta2/tensorflow/controller.go @@ -505,7 +505,7 @@ func (tc *TFController) pastBackoffLimit(tfjob *tfv1beta2.TFJob, pods []*v1.Pod) } for i := range pods { po := pods[i] - if po.Status.Phase == v1.PodRunning || po.Status.Phase != v1.PodPending { + if po.Status.Phase == v1.PodRunning || po.Status.Phase == v1.PodPending { for j := range po.Status.InitContainerStatuses { stat := po.Status.InitContainerStatuses[j] result += stat.RestartCount