From 921b7e6e8f7e88e408e984f3406434e1062ee463 Mon Sep 17 00:00:00 2001 From: kannon92 Date: Wed, 5 Jul 2023 20:11:48 +0000 Subject: [PATCH] remove equalReady and replace with k8 util function --- pkg/controller/job/job_controller.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index 888cb7de6b1..49c186ecc8a 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -893,7 +893,7 @@ func (jm *Controller) syncJob(ctx context.Context, key string) (rErr error) { } } - needsStatusUpdate := suspendCondChanged || active != job.Status.Active || !equalReady(ready, job.Status.Ready) + needsStatusUpdate := suspendCondChanged || active != job.Status.Active || !pointer.Int32Equal(ready, job.Status.Ready) job.Status.Active = active job.Status.Ready = ready err = jm.trackJobStatusAndRemoveFinalizers(ctx, &job, pods, prevSucceededIndexes, *uncounted, expectedRmFinalizers, finishedCondition, needsStatusUpdate, newBackoffRecord) @@ -1744,10 +1744,3 @@ func countReadyPods(pods []*v1.Pod) int32 { } return cnt } - -func equalReady(a, b *int32) bool { - if a != nil && b != nil { - return *a == *b - } - return a == b -}