From f0d917a3caa11aa4d00bb6153c686d7f966c0a76 Mon Sep 17 00:00:00 2001 From: Harry Bagdi Date: Tue, 29 Jun 2021 12:59:59 -0700 Subject: [PATCH] add fuzzer patch to fix tests --- pkg/apis/networking/fuzzer/fuzzer.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/apis/networking/fuzzer/fuzzer.go b/pkg/apis/networking/fuzzer/fuzzer.go index a9f2f552990..7284773a782 100644 --- a/pkg/apis/networking/fuzzer/fuzzer.go +++ b/pkg/apis/networking/fuzzer/fuzzer.go @@ -20,6 +20,7 @@ import ( fuzz "github.com/google/gofuzz" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/kubernetes/pkg/apis/networking" + utilpointer "k8s.io/utils/pointer" ) // Funcs returns the fuzzer functions for the networking api group. @@ -64,5 +65,14 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { } } }, + func(p *networking.IngressClass, c fuzz.Continue) { + c.FuzzNoCustom(p) // fuzz self without calling this function again + // default Parameters to Cluster + if p.Spec.Parameters == nil || p.Spec.Parameters.Scope == nil { + p.Spec.Parameters = &networking.IngressClassParametersReference{ + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeCluster), + } + } + }, } }