From d0b973be7135b7cbed3138d3d5ac70ae3a9bcd88 Mon Sep 17 00:00:00 2001 From: XsWack Date: Mon, 3 Jun 2019 17:48:23 +0800 Subject: [PATCH] fix bug for check PodPending (#1021) --- pkg/controller.v1/tensorflow/controller.go | 2 +- pkg/controller.v1beta2/tensorflow/controller.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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