mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
batch: add suspended job
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
This commit is contained in:
@@ -20,14 +20,9 @@ import (
|
||||
fuzz "github.com/google/gofuzz"
|
||||
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/kubernetes/pkg/apis/batch"
|
||||
"k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func newBool(val bool) *bool {
|
||||
p := new(bool)
|
||||
*p = val
|
||||
return p
|
||||
}
|
||||
|
||||
// Funcs returns the fuzzer functions for the batch api group.
|
||||
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
return []interface{}{
|
||||
@@ -48,7 +43,7 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
j.Parallelism = ¶llelism
|
||||
j.BackoffLimit = &backoffLimit
|
||||
if c.Rand.Int31()%2 == 0 {
|
||||
j.ManualSelector = newBool(true)
|
||||
j.ManualSelector = pointer.BoolPtr(true)
|
||||
} else {
|
||||
j.ManualSelector = nil
|
||||
}
|
||||
@@ -57,6 +52,9 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
} else {
|
||||
j.CompletionMode = batch.IndexedCompletion
|
||||
}
|
||||
// We're fuzzing the internal JobSpec type, not the v1 type, so we don't
|
||||
// need to fuzz the nil value.
|
||||
j.Suspend = pointer.BoolPtr(c.RandBool())
|
||||
},
|
||||
func(sj *batch.CronJobSpec, c fuzz.Continue) {
|
||||
c.FuzzNoCustom(sj)
|
||||
|
||||
Reference in New Issue
Block a user