Job Pod Failure policy - cover testing of negative exit codes

This commit is contained in:
Michal Wozniak
2024-10-25 11:39:22 +02:00
parent e15d5b9da9
commit cad648035a
3 changed files with 103 additions and 0 deletions

View File

@@ -134,6 +134,25 @@ func TestValidateJob(t *testing.T) {
},
},
},
"valid pod failure policy with negative exitCodes - need for Windows support": {
opts: JobValidationOptions{RequirePrefixedLabels: true},
job: batch.Job{
ObjectMeta: validJobObjectMeta,
Spec: batch.JobSpec{
Selector: validGeneratedSelector,
Template: validPodTemplateSpecForGeneratedRestartPolicyNever,
PodFailurePolicy: &batch.PodFailurePolicy{
Rules: []batch.PodFailurePolicyRule{{
Action: batch.PodFailurePolicyActionFailJob,
OnExitCodes: &batch.PodFailurePolicyOnExitCodesRequirement{
Operator: batch.PodFailurePolicyOnExitCodesOpNotIn,
Values: []int32{-1073741819, -1073741676, -1073741510},
},
}},
},
},
},
},
"valid pod failure policy": {
opts: JobValidationOptions{RequirePrefixedLabels: true},
job: batch.Job{