This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
pkg/controller.v1/pytorch Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ package pytorch
17
17
18
18
import (
19
19
"fmt"
20
- "reflect"
21
20
"strings"
22
21
"time"
23
22
24
23
kubebatchclient "github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
25
24
log "github.com/sirupsen/logrus"
26
25
"k8s.io/api/core/v1"
26
+ apiequality "k8s.io/apimachinery/pkg/api/equality"
27
27
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28
28
"k8s.io/apimachinery/pkg/runtime/schema"
29
29
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -430,7 +430,10 @@ func (pc *PyTorchController) reconcilePyTorchJobs(job *pyv1.PyTorchJob) error {
430
430
job .Status .ReplicaStatuses [rtype ].Active = 0
431
431
}
432
432
}
433
- return pc .updateStatusHandler (job )
433
+ if ! apiequality .Semantic .DeepEqual (* oldStatus , job .Status ) {
434
+ return pc .updateStatusHandler (job )
435
+ }
436
+ return nil
434
437
}
435
438
436
439
if pc .Config .EnableGangScheduling {
@@ -465,7 +468,7 @@ func (pc *PyTorchController) reconcilePyTorchJobs(job *pyv1.PyTorchJob) error {
465
468
}
466
469
467
470
// No need to update the job if the status hasn't changed since last time.
468
- if ! reflect .DeepEqual (* oldStatus , job .Status ) {
471
+ if ! apiequality . Semantic .DeepEqual (* oldStatus , job .Status ) {
469
472
return pc .updateStatusHandler (job )
470
473
}
471
474
return nil
You can’t perform that action at this time.
0 commit comments