Merge pull request #101711 from hbagdi/ingressclass-namespaced-params-beta

graduate IngressClassNamespacedParams to beta
This commit is contained in:
Kubernetes Prow Robot
2021-06-29 17:07:03 -07:00
committed by GitHub
4 changed files with 19 additions and 4 deletions

View File

@@ -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),
}
}
},
}
}

View File

@@ -1884,9 +1884,11 @@ func TestValidateIngressClassUpdate(t *testing.T) {
Spec: networking.IngressClassSpec{
Controller: "foo.co/bar",
Parameters: &networking.IngressClassParametersReference{
APIGroup: utilpointer.StringPtr("v1"),
Kind: "ConfigMap",
Name: "foo",
APIGroup: utilpointer.StringPtr("v1"),
Scope: utilpointer.StringPtr("Namespace"),
Kind: "ConfigMap",
Name: "foo",
Namespace: utilpointer.StringPtr("bar"),
},
},
},