mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Remarks to syncJobCtx
This commit is contained in:
@@ -1079,8 +1079,8 @@ func TestGetNewFinshedPods(t *testing.T) {
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
uncounted := newUncountedTerminatedPods(*tc.job.Status.UncountedTerminatedPods)
|
||||
syncJobContext := &syncJobContext{job: &tc.job, pods: tc.pods, uncounted: uncounted, expectedRmFinalizers: tc.expectedRmFinalizers}
|
||||
succeededPods, failedPods := getNewFinishedPods(syncJobContext)
|
||||
jobCtx := &syncJobCtx{job: &tc.job, pods: tc.pods, uncounted: uncounted, expectedRmFinalizers: tc.expectedRmFinalizers}
|
||||
succeededPods, failedPods := getNewFinishedPods(jobCtx)
|
||||
succeeded := int32(len(succeededPods)) + tc.job.Status.Succeeded + int32(len(uncounted.succeeded))
|
||||
failed := int32(len(failedPods)) + tc.job.Status.Failed + int32(len(uncounted.failed))
|
||||
if succeeded != tc.wantSucceeded {
|
||||
@@ -1655,7 +1655,7 @@ func TestTrackJobStatusAndRemoveFinalizers(t *testing.T) {
|
||||
if isIndexedJob(job) {
|
||||
succeededIndexes = succeededIndexesFromString(logger, job.Status.CompletedIndexes, int(*job.Spec.Completions))
|
||||
}
|
||||
syncJobContext := &syncJobContext{
|
||||
jobCtx := &syncJobCtx{
|
||||
job: job,
|
||||
pods: tc.pods,
|
||||
succeededIndexes: succeededIndexes,
|
||||
@@ -1664,7 +1664,7 @@ func TestTrackJobStatusAndRemoveFinalizers(t *testing.T) {
|
||||
finishedCondition: tc.finishedCond,
|
||||
newBackoffRecord: backoffRecord{},
|
||||
}
|
||||
err := manager.trackJobStatusAndRemoveFinalizers(context.TODO(), syncJobContext, tc.needsFlush)
|
||||
err := manager.trackJobStatusAndRemoveFinalizers(ctx, jobCtx, tc.needsFlush)
|
||||
if !errors.Is(err, tc.wantErr) {
|
||||
t.Errorf("Got error %v, want %v", err, tc.wantErr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user