mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
fix: improve PodReplacementPolicy integration test case names and update deprecated methods
This commit is contained in:
parent
e73edf7764
commit
056b25dfca
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"k8s.io/utils/ptr"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -1757,31 +1758,31 @@ func TestJobPodReplacementPolicy(t *testing.T) {
|
|||||||
},
|
},
|
||||||
wantActive: int(podCount),
|
wantActive: int(podCount),
|
||||||
},
|
},
|
||||||
"feature flag true, delete pods, verify active and failed status and recreate once failed": {
|
"feature flag true, recreate failed pods, and verify active and failed counters": {
|
||||||
podReplacementPolicyEnabled: true,
|
podReplacementPolicyEnabled: true,
|
||||||
failPods: true,
|
failPods: true,
|
||||||
jobSpec: &batchv1.JobSpec{
|
jobSpec: &batchv1.JobSpec{
|
||||||
Parallelism: pointer.Int32Ptr(podCount),
|
Parallelism: ptr.To(podCount),
|
||||||
Completions: pointer.Int32Ptr(podCount),
|
Completions: ptr.To(podCount),
|
||||||
CompletionMode: &indexedCompletion,
|
CompletionMode: &indexedCompletion,
|
||||||
PodReplacementPolicy: podReplacementPolicy(batchv1.Failed),
|
PodReplacementPolicy: podReplacementPolicy(batchv1.Failed),
|
||||||
},
|
},
|
||||||
wantActive: int(podCount),
|
wantActive: int(podCount),
|
||||||
wantFailed: int(podCount),
|
wantFailed: int(podCount),
|
||||||
wantTerminating: pointer.Int32(0),
|
wantTerminating: ptr.To[int32](0),
|
||||||
},
|
},
|
||||||
"feature flag true with NonIndexedJob, delete pods, verify active and failed status and recreate once failed": {
|
"feature flag true with NonIndexedJob, recreate failed pods, and verify active and failed counters": {
|
||||||
podReplacementPolicyEnabled: true,
|
podReplacementPolicyEnabled: true,
|
||||||
failPods: true,
|
failPods: true,
|
||||||
jobSpec: &batchv1.JobSpec{
|
jobSpec: &batchv1.JobSpec{
|
||||||
Parallelism: pointer.Int32Ptr(podCount),
|
Parallelism: ptr.To(podCount),
|
||||||
Completions: pointer.Int32Ptr(podCount),
|
Completions: ptr.To(podCount),
|
||||||
CompletionMode: &nonIndexedCompletion,
|
CompletionMode: &nonIndexedCompletion,
|
||||||
PodReplacementPolicy: podReplacementPolicy(batchv1.Failed),
|
PodReplacementPolicy: podReplacementPolicy(batchv1.Failed),
|
||||||
},
|
},
|
||||||
wantActive: int(podCount),
|
wantActive: int(podCount),
|
||||||
wantFailed: int(podCount),
|
wantFailed: int(podCount),
|
||||||
wantTerminating: pointer.Int32(0),
|
wantTerminating: ptr.To[int32](0),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for name, tc := range cases {
|
for name, tc := range cases {
|
||||||
|
Loading…
Reference in New Issue
Block a user