Skip to content

Commit

Permalink
Fix the TestRoundTripTypes by adding default to the fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
mimowo authored and danielye11 committed Sep 21, 2022
1 parent b44d5c9 commit 4c9ec0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/apis/batch/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
fuzz "github.com/google/gofuzz"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/kubernetes/pkg/apis/batch"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/utils/pointer"
)

Expand Down Expand Up @@ -72,5 +73,11 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
policies := []batch.ConcurrencyPolicy{batch.AllowConcurrent, batch.ForbidConcurrent, batch.ReplaceConcurrent}
*cp = policies[c.Rand.Intn(len(policies))]
},
func(p *batch.PodFailurePolicyOnPodConditionsPattern, c fuzz.Continue) {
c.FuzzNoCustom(p)
if p.Status == "" {
p.Status = api.ConditionTrue
}
},
}
}

0 comments on commit 4c9ec0e

Please sign in to comment.