mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 15:50:10 +00:00
Merge pull request #119111 from kannon92/remove-equal-ready-job
remove equalReady and replace with k8 util function
This commit is contained in:
commit
7e5506de8d
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user