From a7fc92089a42aff0c2f10d56b0ee290440adfbc4 Mon Sep 17 00:00:00 2001 From: Harry Bagdi Date: Sat, 6 Mar 2021 03:03:20 +0530 Subject: [PATCH] Add namespace scoped ParametersReference to IngressClass --- api/openapi-spec/swagger.json | 64 +- pkg/apis/networking/types.go | 37 +- pkg/apis/networking/v1/defaults.go | 12 + pkg/apis/networking/v1/defaults_test.go | 130 ++++ .../networking/v1/zz_generated.conversion.go | 42 +- .../networking/v1/zz_generated.defaults.go | 13 + .../v1beta1/zz_generated.conversion.go | 42 +- pkg/apis/networking/validation/validation.go | 59 +- .../networking/validation/validation_test.go | 181 +++++- pkg/apis/networking/zz_generated.deepcopy.go | 33 +- pkg/features/kube_features.go | 9 + pkg/printers/internalversion/printers_test.go | 4 +- .../networking/ingressclass/strategy.go | 21 + .../networking/ingressclass/strategy_test.go | 287 ++++++++- .../k8s.io/api/networking/v1/generated.pb.go | 561 ++++++++++++++---- .../k8s.io/api/networking/v1/generated.proto | 32 +- staging/src/k8s.io/api/networking/v1/types.go | 37 +- .../v1/types_swagger_doc_generated.go | 13 + .../networking/v1/zz_generated.deepcopy.go | 33 +- .../api/networking/v1beta1/generated.pb.go | 485 ++++++++++++--- .../api/networking/v1beta1/generated.proto | 32 +- .../k8s.io/api/networking/v1beta1/types.go | 37 +- .../v1beta1/types_swagger_doc_generated.go | 13 + .../v1beta1/zz_generated.deepcopy.go | 33 +- .../networking.k8s.io.v1.IngressClass.json | 4 +- .../HEAD/networking.k8s.io.v1.IngressClass.pb | Bin 241 -> 249 bytes .../networking.k8s.io.v1.IngressClass.yaml | 2 + ...etworking.k8s.io.v1beta1.IngressClass.json | 4 +- .../networking.k8s.io.v1beta1.IngressClass.pb | Bin 246 -> 254 bytes ...etworking.k8s.io.v1beta1.IngressClass.yaml | 2 + ...8s.io.v1.IngressClass.after_roundtrip.json | 52 ++ ...8s.io.v1.IngressClass.after_roundtrip.yaml | 38 ++ ....v1beta1.IngressClass.after_roundtrip.json | 52 ++ ....v1beta1.IngressClass.after_roundtrip.yaml | 38 ++ ...8s.io.v1.IngressClass.after_roundtrip.json | 52 ++ ...8s.io.v1.IngressClass.after_roundtrip.yaml | 38 ++ ....v1beta1.IngressClass.after_roundtrip.json | 52 ++ ....v1beta1.IngressClass.after_roundtrip.yaml | 38 ++ .../v1/ingressclassparametersreference.go | 75 +++ .../networking/v1/ingressclassspec.go | 10 +- .../ingressclassparametersreference.go | 75 +++ .../networking/v1beta1/ingressclassspec.go | 10 +- .../client-go/applyconfigurations/utils.go | 4 + .../kubectl/pkg/describe/describe_test.go | 4 +- 44 files changed, 2535 insertions(+), 225 deletions(-) create mode 100644 staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json create mode 100644 staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml create mode 100644 staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json create mode 100644 staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml create mode 100644 staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json create mode 100644 staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml create mode 100644 staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json create mode 100644 staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml create mode 100644 staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassparametersreference.go create mode 100644 staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index d465da1ecd45..cd640b2b4763 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -12337,6 +12337,36 @@ } ] }, + "io.k8s.api.networking.v1.IngressClassParametersReference": { + "description": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", + "properties": { + "apiGroup": { + "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": "string" + }, + "kind": { + "description": "Kind is the type of resource being referenced.", + "type": "string" + }, + "name": { + "description": "Name is the name of resource being referenced.", + "type": "string" + }, + "namespace": { + "description": "Namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", + "type": "string" + }, + "scope": { + "description": "Scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\". Field can be enabled with IngressClassNamespacedParams feature gate.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, "io.k8s.api.networking.v1.IngressClassSpec": { "description": "IngressClassSpec provides information about the class of an Ingress.", "properties": { @@ -12345,7 +12375,7 @@ "type": "string" }, "parameters": { - "$ref": "#/definitions/io.k8s.api.core.v1.TypedLocalObjectReference", + "$ref": "#/definitions/io.k8s.api.networking.v1.IngressClassParametersReference", "description": "Parameters is a link to a custom resource containing additional configuration for the controller. This is optional if the controller does not require extra parameters." } }, @@ -12816,6 +12846,36 @@ } ] }, + "io.k8s.api.networking.v1beta1.IngressClassParametersReference": { + "description": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", + "properties": { + "apiGroup": { + "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "type": "string" + }, + "kind": { + "description": "Kind is the type of resource being referenced.", + "type": "string" + }, + "name": { + "description": "Name is the name of resource being referenced.", + "type": "string" + }, + "namespace": { + "description": "Namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", + "type": "string" + }, + "scope": { + "description": "Scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\". Field can be enabled with IngressClassNamespacedParams feature gate.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, "io.k8s.api.networking.v1beta1.IngressClassSpec": { "description": "IngressClassSpec provides information about the class of an Ingress.", "properties": { @@ -12824,7 +12884,7 @@ "type": "string" }, "parameters": { - "$ref": "#/definitions/io.k8s.api.core.v1.TypedLocalObjectReference", + "$ref": "#/definitions/io.k8s.api.networking.v1beta1.IngressClassParametersReference", "description": "Parameters is a link to a custom resource containing additional configuration for the controller. This is optional if the controller does not require extra parameters." } }, diff --git a/pkg/apis/networking/types.go b/pkg/apis/networking/types.go index a8cb459467ed..565aea9784a7 100644 --- a/pkg/apis/networking/types.go +++ b/pkg/apis/networking/types.go @@ -313,7 +313,42 @@ type IngressClassSpec struct { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - Parameters *api.TypedLocalObjectReference + Parameters *IngressClassParametersReference +} + +const ( + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is namespace-scoped. + IngressClassParametersReferenceScopeNamespace = "Namespace" + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is cluster-scoped. + IngressClassParametersReferenceScopeCluster = "Cluster" +) + +// IngressClassParametersReference identifies an API object. This can be used +// to specify a cluster or namespace-scoped resource. +type IngressClassParametersReference struct { + // APIGroup is the group for the resource being referenced. If APIGroup is + // not specified, the specified Kind must be in the core API group. For any + // other third-party types, APIGroup is required. + // +optional + APIGroup *string + // Kind is the type of resource being referenced. + Kind string + // Name is the name of resource being referenced. + Name string + // Scope represents if this refers to a cluster or namespace scoped resource. + // This may be set to "Cluster" (default) or "Namespace". + // Field can be enabled with IngressClassNamespacedParams feature gate. + // +optional + // +featureGate=IngressClassNamespacedParams + Scope *string + // Namespace is the namespace of the resource being referenced. This field is + // required when scope is set to "Namespace" and must be unset when scope is set to + // "Cluster". + // +optional + // +featureGate=IngressClassNamespacedParams + Namespace *string } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/networking/v1/defaults.go b/pkg/apis/networking/v1/defaults.go index fce71ce71141..9ce991e8c753 100644 --- a/pkg/apis/networking/v1/defaults.go +++ b/pkg/apis/networking/v1/defaults.go @@ -20,6 +20,9 @@ import ( "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/runtime" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/kubernetes/pkg/features" + utilpointer "k8s.io/utils/pointer" ) func addDefaultingFuncs(scheme *runtime.Scheme) error { @@ -43,3 +46,12 @@ func SetDefaults_NetworkPolicy(obj *networkingv1.NetworkPolicy) { } } } + +func SetDefaults_IngressClass(obj *networkingv1.IngressClass) { + if !utilfeature.DefaultFeatureGate.Enabled(features.IngressClassNamespacedParams) { + return + } + if obj.Spec.Parameters != nil && obj.Spec.Parameters.Scope == nil { + obj.Spec.Parameters.Scope = utilpointer.StringPtr(networkingv1.IngressClassParametersReferenceScopeCluster) + } +} diff --git a/pkg/apis/networking/v1/defaults_test.go b/pkg/apis/networking/v1/defaults_test.go index 7da30adcc598..023b21e5f349 100644 --- a/pkg/apis/networking/v1/defaults_test.go +++ b/pkg/apis/networking/v1/defaults_test.go @@ -24,10 +24,14 @@ import ( apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + utilfeature "k8s.io/apiserver/pkg/util/feature" + featuregatetesting "k8s.io/component-base/featuregate/testing" "k8s.io/kubernetes/pkg/api/legacyscheme" _ "k8s.io/kubernetes/pkg/apis/core/install" _ "k8s.io/kubernetes/pkg/apis/networking/install" . "k8s.io/kubernetes/pkg/apis/networking/v1" + "k8s.io/kubernetes/pkg/features" + utilpointer "k8s.io/utils/pointer" ) func TestSetDefaultNetworkPolicy(t *testing.T) { @@ -234,6 +238,132 @@ func TestSetDefaultNetworkPolicy(t *testing.T) { } } +func TestSetDefaultsForIngressClassParametersReference(t *testing.T) { + tests := []struct { + name string + original *networkingv1.IngressClass + expected *networkingv1.IngressClass + enableNamespaceScopedParamsGate bool + }{ + { + name: "populated parameters sets the default Scope when feature is enabled", + original: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + expected: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networkingv1.IngressClassParametersReferenceScopeCluster), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + { + name: "existing scope is not overridden when feature is enabled", + original: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networkingv1.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + expected: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networkingv1.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + { + name: "empty Parameters does not set the default Scope when feature is enabled", + original: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + }, + }, + expected: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + }, + }, + enableNamespaceScopedParamsGate: true, + }, + { + name: "populated parameters does not set the default Scope when feature is disabled", + original: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + expected: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + Parameters: &networkingv1.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + enableNamespaceScopedParamsGate: false, + }, + { + name: "empty Parameters does not set the default Scope when feature is disabled", + original: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + }, + }, + expected: &networkingv1.IngressClass{ + Spec: networkingv1.IngressClassSpec{ + Controller: "controller", + }, + }, + enableNamespaceScopedParamsGate: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + original := test.original + expected := test.expected + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IngressClassNamespacedParams, test.enableNamespaceScopedParamsGate)() + obj2 := roundTrip(t, runtime.Object(original)) + got, ok := obj2.(*networkingv1.IngressClass) + if !ok { + t.Errorf("unexpected object: %v", got) + t.FailNow() + } + if !apiequality.Semantic.DeepEqual(got.Spec, expected.Spec) { + t.Errorf("got different than expected\ngot:\n\t%+v\nexpected:\n\t%+v", got.Spec, expected.Spec) + } + }) + } +} + func roundTrip(t *testing.T, obj runtime.Object) runtime.Object { t.Helper() data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(SchemeGroupVersion), obj) diff --git a/pkg/apis/networking/v1/zz_generated.conversion.go b/pkg/apis/networking/v1/zz_generated.conversion.go index 3aee2a23042b..f18732652873 100644 --- a/pkg/apis/networking/v1/zz_generated.conversion.go +++ b/pkg/apis/networking/v1/zz_generated.conversion.go @@ -111,6 +111,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*v1.IngressClassParametersReference)(nil), (*networking.IngressClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_IngressClassParametersReference_To_networking_IngressClassParametersReference(a.(*v1.IngressClassParametersReference), b.(*networking.IngressClassParametersReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*networking.IngressClassParametersReference)(nil), (*v1.IngressClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_networking_IngressClassParametersReference_To_v1_IngressClassParametersReference(a.(*networking.IngressClassParametersReference), b.(*v1.IngressClassParametersReference), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*v1.IngressClassSpec)(nil), (*networking.IngressClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_IngressClassSpec_To_networking_IngressClassSpec(a.(*v1.IngressClassSpec), b.(*networking.IngressClassSpec), scope) }); err != nil { @@ -446,9 +456,37 @@ func Convert_networking_IngressClassList_To_v1_IngressClassList(in *networking.I return autoConvert_networking_IngressClassList_To_v1_IngressClassList(in, out, s) } +func autoConvert_v1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in *v1.IngressClassParametersReference, out *networking.IngressClassParametersReference, s conversion.Scope) error { + out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) + out.Kind = in.Kind + out.Name = in.Name + out.Scope = (*string)(unsafe.Pointer(in.Scope)) + out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) + return nil +} + +// Convert_v1_IngressClassParametersReference_To_networking_IngressClassParametersReference is an autogenerated conversion function. +func Convert_v1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in *v1.IngressClassParametersReference, out *networking.IngressClassParametersReference, s conversion.Scope) error { + return autoConvert_v1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in, out, s) +} + +func autoConvert_networking_IngressClassParametersReference_To_v1_IngressClassParametersReference(in *networking.IngressClassParametersReference, out *v1.IngressClassParametersReference, s conversion.Scope) error { + out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) + out.Kind = in.Kind + out.Name = in.Name + out.Scope = (*string)(unsafe.Pointer(in.Scope)) + out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) + return nil +} + +// Convert_networking_IngressClassParametersReference_To_v1_IngressClassParametersReference is an autogenerated conversion function. +func Convert_networking_IngressClassParametersReference_To_v1_IngressClassParametersReference(in *networking.IngressClassParametersReference, out *v1.IngressClassParametersReference, s conversion.Scope) error { + return autoConvert_networking_IngressClassParametersReference_To_v1_IngressClassParametersReference(in, out, s) +} + func autoConvert_v1_IngressClassSpec_To_networking_IngressClassSpec(in *v1.IngressClassSpec, out *networking.IngressClassSpec, s conversion.Scope) error { out.Controller = in.Controller - out.Parameters = (*core.TypedLocalObjectReference)(unsafe.Pointer(in.Parameters)) + out.Parameters = (*networking.IngressClassParametersReference)(unsafe.Pointer(in.Parameters)) return nil } @@ -459,7 +497,7 @@ func Convert_v1_IngressClassSpec_To_networking_IngressClassSpec(in *v1.IngressCl func autoConvert_networking_IngressClassSpec_To_v1_IngressClassSpec(in *networking.IngressClassSpec, out *v1.IngressClassSpec, s conversion.Scope) error { out.Controller = in.Controller - out.Parameters = (*corev1.TypedLocalObjectReference)(unsafe.Pointer(in.Parameters)) + out.Parameters = (*v1.IngressClassParametersReference)(unsafe.Pointer(in.Parameters)) return nil } diff --git a/pkg/apis/networking/v1/zz_generated.defaults.go b/pkg/apis/networking/v1/zz_generated.defaults.go index 3962a1376b09..14652c005ae4 100644 --- a/pkg/apis/networking/v1/zz_generated.defaults.go +++ b/pkg/apis/networking/v1/zz_generated.defaults.go @@ -29,11 +29,24 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&v1.IngressClass{}, func(obj interface{}) { SetObjectDefaults_IngressClass(obj.(*v1.IngressClass)) }) + scheme.AddTypeDefaultingFunc(&v1.IngressClassList{}, func(obj interface{}) { SetObjectDefaults_IngressClassList(obj.(*v1.IngressClassList)) }) scheme.AddTypeDefaultingFunc(&v1.NetworkPolicy{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicy(obj.(*v1.NetworkPolicy)) }) scheme.AddTypeDefaultingFunc(&v1.NetworkPolicyList{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicyList(obj.(*v1.NetworkPolicyList)) }) return nil } +func SetObjectDefaults_IngressClass(in *v1.IngressClass) { + SetDefaults_IngressClass(in) +} + +func SetObjectDefaults_IngressClassList(in *v1.IngressClassList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_IngressClass(a) + } +} + func SetObjectDefaults_NetworkPolicy(in *v1.NetworkPolicy) { SetDefaults_NetworkPolicy(in) for i := range in.Spec.Ingress { diff --git a/pkg/apis/networking/v1beta1/zz_generated.conversion.go b/pkg/apis/networking/v1beta1/zz_generated.conversion.go index 53e7c1bc231b..459730570674 100644 --- a/pkg/apis/networking/v1beta1/zz_generated.conversion.go +++ b/pkg/apis/networking/v1beta1/zz_generated.conversion.go @@ -89,6 +89,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*v1beta1.IngressClassParametersReference)(nil), (*networking.IngressClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IngressClassParametersReference_To_networking_IngressClassParametersReference(a.(*v1beta1.IngressClassParametersReference), b.(*networking.IngressClassParametersReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*networking.IngressClassParametersReference)(nil), (*v1beta1.IngressClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_networking_IngressClassParametersReference_To_v1beta1_IngressClassParametersReference(a.(*networking.IngressClassParametersReference), b.(*v1beta1.IngressClassParametersReference), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*v1beta1.IngressClassSpec)(nil), (*networking.IngressClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_IngressClassSpec_To_networking_IngressClassSpec(a.(*v1beta1.IngressClassSpec), b.(*networking.IngressClassSpec), scope) }); err != nil { @@ -333,9 +343,37 @@ func Convert_networking_IngressClassList_To_v1beta1_IngressClassList(in *network return autoConvert_networking_IngressClassList_To_v1beta1_IngressClassList(in, out, s) } +func autoConvert_v1beta1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in *v1beta1.IngressClassParametersReference, out *networking.IngressClassParametersReference, s conversion.Scope) error { + out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) + out.Kind = in.Kind + out.Name = in.Name + out.Scope = (*string)(unsafe.Pointer(in.Scope)) + out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) + return nil +} + +// Convert_v1beta1_IngressClassParametersReference_To_networking_IngressClassParametersReference is an autogenerated conversion function. +func Convert_v1beta1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in *v1beta1.IngressClassParametersReference, out *networking.IngressClassParametersReference, s conversion.Scope) error { + return autoConvert_v1beta1_IngressClassParametersReference_To_networking_IngressClassParametersReference(in, out, s) +} + +func autoConvert_networking_IngressClassParametersReference_To_v1beta1_IngressClassParametersReference(in *networking.IngressClassParametersReference, out *v1beta1.IngressClassParametersReference, s conversion.Scope) error { + out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) + out.Kind = in.Kind + out.Name = in.Name + out.Scope = (*string)(unsafe.Pointer(in.Scope)) + out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) + return nil +} + +// Convert_networking_IngressClassParametersReference_To_v1beta1_IngressClassParametersReference is an autogenerated conversion function. +func Convert_networking_IngressClassParametersReference_To_v1beta1_IngressClassParametersReference(in *networking.IngressClassParametersReference, out *v1beta1.IngressClassParametersReference, s conversion.Scope) error { + return autoConvert_networking_IngressClassParametersReference_To_v1beta1_IngressClassParametersReference(in, out, s) +} + func autoConvert_v1beta1_IngressClassSpec_To_networking_IngressClassSpec(in *v1beta1.IngressClassSpec, out *networking.IngressClassSpec, s conversion.Scope) error { out.Controller = in.Controller - out.Parameters = (*core.TypedLocalObjectReference)(unsafe.Pointer(in.Parameters)) + out.Parameters = (*networking.IngressClassParametersReference)(unsafe.Pointer(in.Parameters)) return nil } @@ -346,7 +384,7 @@ func Convert_v1beta1_IngressClassSpec_To_networking_IngressClassSpec(in *v1beta1 func autoConvert_networking_IngressClassSpec_To_v1beta1_IngressClassSpec(in *networking.IngressClassSpec, out *v1beta1.IngressClassSpec, s conversion.Scope) error { out.Controller = in.Controller - out.Parameters = (*v1.TypedLocalObjectReference)(unsafe.Pointer(in.Parameters)) + out.Parameters = (*v1beta1.IngressClassParametersReference)(unsafe.Pointer(in.Parameters)) return nil } diff --git a/pkg/apis/networking/validation/validation.go b/pkg/apis/networking/validation/validation.go index 266348ea0709..1b4acf52b516 100644 --- a/pkg/apis/networking/validation/validation.go +++ b/pkg/apis/networking/validation/validation.go @@ -31,9 +31,12 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" + utilfeature "k8s.io/apiserver/pkg/util/feature" api "k8s.io/kubernetes/pkg/apis/core" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/apis/networking" + "k8s.io/kubernetes/pkg/features" + utilpointer "k8s.io/utils/pointer" ) const ( @@ -49,6 +52,11 @@ var ( ) invalidPathSequences = []string{"//", "/./", "/../", "%2f", "%2F"} invalidPathSuffixes = []string{"/..", "/."} + + supportedIngressClassParametersReferenceScopes = sets.NewString( + networking.IngressClassParametersReferenceScopeNamespace, + networking.IngressClassParametersReferenceScopeCluster, + ) ) // ValidateNetworkPolicyName can be used to check whether the given networkpolicy @@ -518,7 +526,7 @@ func validateIngressClassSpec(spec *networking.IngressClassSpec, fldPath *field. allErrs = append(allErrs, field.TooLong(fldPath.Child("controller"), spec.Controller, maxLenIngressClassController)) } allErrs = append(allErrs, validation.IsDomainPrefixedPath(fldPath.Child("controller"), spec.Controller)...) - allErrs = append(allErrs, validateIngressTypedLocalObjectReference(spec.Parameters, fldPath.Child("parameters"))...) + allErrs = append(allErrs, validateIngressClassParametersReference(spec.Parameters, fldPath.Child("parameters"))...) return allErrs } @@ -561,6 +569,55 @@ func validateIngressTypedLocalObjectReference(params *api.TypedLocalObjectRefere return allErrs } +// validateIngressClassParametersReference ensures that Parameters fields are valid. +// Parameters was previously of type `TypedLocalObjectReference` and used +// `validateIngressTypedLocalObjectReference()`. This function extends validation +// for additional fields introduced for namespace-scoped references. +func validateIngressClassParametersReference(params *networking.IngressClassParametersReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if params == nil { + return allErrs + } + + allErrs = append(allErrs, validateIngressTypedLocalObjectReference(&api.TypedLocalObjectReference{ + APIGroup: params.APIGroup, + Kind: params.Kind, + Name: params.Name, + }, fldPath)...) + + if utilfeature.DefaultFeatureGate.Enabled(features.IngressClassNamespacedParams) && params.Scope == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("scope"), "")) + return allErrs + } + + if params.Scope != nil || params.Namespace != nil { + scope := utilpointer.StringPtrDerefOr(params.Scope, "") + + if !supportedIngressClassParametersReferenceScopes.Has(scope) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("scope"), scope, + supportedIngressClassParametersReferenceScopes.List())) + } else { + + if scope == networking.IngressClassParametersReferenceScopeNamespace { + if params.Namespace == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("namespace"), "`parameters.scope` is set to 'Namespace'")) + } else { + for _, msg := range apivalidation.ValidateNamespaceName(*params.Namespace, false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), *params.Namespace, msg)) + } + } + } + + if scope == networking.IngressClassParametersReferenceScopeCluster && params.Namespace != nil { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "`parameters.scope` is set to 'Cluster'")) + } + } + } + + return allErrs +} + func allowInvalidSecretName(gv schema.GroupVersion, oldIngress *networking.Ingress) bool { if gv == networkingv1beta1.SchemeGroupVersion || gv == extensionsv1beta1.SchemeGroupVersion { // backwards compatibility with released API versions that allowed invalid names diff --git a/pkg/apis/networking/validation/validation_test.go b/pkg/apis/networking/validation/validation_test.go index c03fd0af1eeb..696fa403ab79 100644 --- a/pkg/apis/networking/validation/validation_test.go +++ b/pkg/apis/networking/validation/validation_test.go @@ -28,8 +28,11 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/validation/field" + utilfeature "k8s.io/apiserver/pkg/util/feature" + featuregatetesting "k8s.io/component-base/featuregate/testing" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/networking" + "k8s.io/kubernetes/pkg/features" utilpointer "k8s.io/utils/pointer" ) @@ -2239,8 +2242,9 @@ func TestValidateIngressUpdate(t *testing.T) { func TestValidateIngressClass(t *testing.T) { testCases := map[string]struct { - ingressClass networking.IngressClass - expectedErrs field.ErrorList + ingressClass networking.IngressClass + expectedErrs field.ErrorList + enableNamespaceScopedParamsGate bool }{ "valid name, valid controller": { ingressClass: networking.IngressClass{ @@ -2292,7 +2296,7 @@ func TestValidateIngressClass(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "test123"}, Spec: networking.IngressClassSpec{ Controller: "foo.co/bar", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("example.com"), Kind: "foo", Name: "bar", @@ -2306,7 +2310,7 @@ func TestValidateIngressClass(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "test123"}, Spec: networking.IngressClassSpec{ Controller: "foo.co/bar", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("example.com"), Name: "bar", }, @@ -2319,7 +2323,7 @@ func TestValidateIngressClass(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "test123"}, Spec: networking.IngressClassSpec{ Controller: "foo.co/bar", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ Kind: "foo", }, }, @@ -2331,7 +2335,7 @@ func TestValidateIngressClass(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "test123"}, Spec: networking.IngressClassSpec{ Controller: "foo.co/bar", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ Kind: "foo/", Name: "bar", }, @@ -2339,10 +2343,173 @@ func TestValidateIngressClass(t *testing.T) { }, expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec.parameters.kind"), "foo/", "may not contain '/'")}, }, + "valid name, valid controller, invalid params (bad scope)": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("bad-scope"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.NotSupported(field.NewPath("spec.parameters.scope"), + "bad-scope", []string{"Cluster", "Namespace"})}, + }, + "valid name, valid controller, valid Namespace scope": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Namespace"), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{}, + }, + "valid name, valid controller, valid scope, invalid namespace": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Namespace"), + Namespace: utilpointer.StringPtr("foo_ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.Invalid(field.NewPath("spec.parameters.namespace"), "foo_ns", + "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-',"+ + " and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', "+ + "regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')")}, + }, + "valid name, valid controller, valid Cluster scope": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Cluster"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{}, + }, + "namespace not set when scope is Namespace": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Namespace"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.Required(field.NewPath("spec.parameters.namespace"), + "`parameters.scope` is set to 'Namespace'")}, + }, + "namespace is forbidden when scope is Cluster": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Cluster"), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.Forbidden(field.NewPath("spec.parameters.namespace"), + "`parameters.scope` is set to 'Cluster'")}, + }, + "empty namespace is forbidden when scope is Cluster": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("Cluster"), + Namespace: utilpointer.StringPtr(""), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.Forbidden(field.NewPath("spec.parameters.namespace"), + "`parameters.scope` is set to 'Cluster'")}, + }, + "validation is performed when feature gate is disabled and scope is not empty": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Scope: utilpointer.StringPtr("bad-scope"), + }, + }, + }, + enableNamespaceScopedParamsGate: false, + expectedErrs: field.ErrorList{field.NotSupported(field.NewPath("spec.parameters.scope"), + "bad-scope", []string{"Cluster", "Namespace"})}, + }, + "validation fails when feature gate is enabled and scope is not set": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + }, + }, + }, + enableNamespaceScopedParamsGate: true, + expectedErrs: field.ErrorList{field.Required(field.NewPath("spec.parameters.scope"), "")}, + }, + "validation is performed when feature gate is disabled and namespace is not empty": { + ingressClass: networking.IngressClass{ + ObjectMeta: metav1.ObjectMeta{Name: "test123"}, + Spec: networking.IngressClassSpec{ + Controller: "foo.co/bar", + Parameters: &networking.IngressClassParametersReference{ + Kind: "foo", + Name: "bar", + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: false, + expectedErrs: field.ErrorList{field.NotSupported(field.NewPath("spec.parameters.scope"), + "", []string{"Cluster", "Namespace"})}, + }, } for name, testCase := range testCases { t.Run(name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IngressClassNamespacedParams, testCase.enableNamespaceScopedParamsGate)() errs := ValidateIngressClass(&testCase.ingressClass) if len(errs) != len(testCase.expectedErrs) { @@ -2390,7 +2557,7 @@ func TestValidateIngressClassUpdate(t *testing.T) { }, Spec: networking.IngressClassSpec{ Controller: "foo.co/bar", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("v1"), Kind: "ConfigMap", Name: "foo", diff --git a/pkg/apis/networking/zz_generated.deepcopy.go b/pkg/apis/networking/zz_generated.deepcopy.go index de9c0959c2ef..b19d0773325f 100644 --- a/pkg/apis/networking/zz_generated.deepcopy.go +++ b/pkg/apis/networking/zz_generated.deepcopy.go @@ -207,12 +207,43 @@ func (in *IngressClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressClassParametersReference) DeepCopyInto(out *IngressClassParametersReference) { + *out = *in + if in.APIGroup != nil { + in, out := &in.APIGroup, &out.APIGroup + *out = new(string) + **out = **in + } + if in.Scope != nil { + in, out := &in.Scope, &out.Scope + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressClassParametersReference. +func (in *IngressClassParametersReference) DeepCopy() *IngressClassParametersReference { + if in == nil { + return nil + } + out := new(IngressClassParametersReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressClassSpec) DeepCopyInto(out *IngressClassSpec) { *out = *in if in.Parameters != nil { in, out := &in.Parameters, &out.Parameters - *out = new(core.TypedLocalObjectReference) + *out = new(IngressClassParametersReference) (*in).DeepCopyInto(*out) } return diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 1aa4a3e6ea8e..8e07668128fc 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -682,11 +682,13 @@ const ( // // Enables controlling pod ranking on replicaset scale-down. PodDeletionCost featuregate.Feature = "PodDeletionCost" + // owner: @ahg-g // alpha: v1.21 // // Allow specifying NamespaceSelector in PodAffinityTerm. PodAffinityNamespaceSelector featuregate.Feature = "PodAffinityNamespaceSelector" + // owner: @andrewsykim @xudongliuharold // alpha: v1.21 // @@ -698,6 +700,12 @@ const ( // // Enables scaling down replicas via logarithmic comparison of creation/ready timestamps LogarithmicScaleDown featuregate.Feature = "LogarithmicScaleDown" + + // owner: @hbagdi + // alpha: v1.21 + // + // Enable Scope and Namespace fields on IngressClassParametersReference. + IngressClassNamespacedParams featuregate.Feature = "IngressClassNamespacedParams" ) func init() { @@ -804,6 +812,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS PodAffinityNamespaceSelector: {Default: false, PreRelease: featuregate.Alpha}, ServiceLoadBalancerClass: {Default: false, PreRelease: featuregate.Alpha}, LogarithmicScaleDown: {Default: false, PreRelease: featuregate.Alpha}, + IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha}, // inherited features from generic apiserver, relisted here to get a conflict if it is changed // unintentionally on either side: diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index cf76ac027153..a0a702bfe36d 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -1012,7 +1012,7 @@ func TestPrintIngressClass(t *testing.T) { }, Spec: networking.IngressClassSpec{ Controller: "example.com/controller", - Parameters: &api.TypedLocalObjectReference{Kind: "customgroup", Name: "example"}, + Parameters: &networking.IngressClassParametersReference{Kind: "customgroup", Name: "example"}, }, }, expected: []metav1.TableRow{{Cells: []interface{}{"test1", "example.com/controller", "customgroup/example", "10y"}}}, @@ -1025,7 +1025,7 @@ func TestPrintIngressClass(t *testing.T) { }, Spec: networking.IngressClassSpec{ Controller: "example.com/controller", - Parameters: &api.TypedLocalObjectReference{ + Parameters: &networking.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("example.com"), Kind: "customgroup", Name: "example", diff --git a/pkg/registry/networking/ingressclass/strategy.go b/pkg/registry/networking/ingressclass/strategy.go index af00a4e915c9..ccd656cbf998 100644 --- a/pkg/registry/networking/ingressclass/strategy.go +++ b/pkg/registry/networking/ingressclass/strategy.go @@ -23,9 +23,11 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apiserver/pkg/storage/names" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/networking" "k8s.io/kubernetes/pkg/apis/networking/validation" + "k8s.io/kubernetes/pkg/features" ) // ingressClassStrategy implements verification logic for IngressClass @@ -49,6 +51,10 @@ func (ingressClassStrategy) NamespaceScoped() bool { func (ingressClassStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { ingressClass := obj.(*networking.IngressClass) ingressClass.Generation = 1 + + if !utilfeature.DefaultFeatureGate.Enabled(features.IngressClassNamespacedParams) { + dropIngressClassParametersReferenceScope(ingressClass) + } } // PrepareForUpdate clears fields that are not allowed to be set by end users on @@ -63,6 +69,9 @@ func (ingressClassStrategy) PrepareForUpdate(ctx context.Context, obj, old runti newIngressClass.Generation = oldIngressClass.Generation + 1 } + if !utilfeature.DefaultFeatureGate.Enabled(features.IngressClassNamespacedParams) && !scopeInUse(oldIngressClass) { + dropIngressClassParametersReferenceScope(newIngressClass) + } } // Validate validates a new IngressClass. @@ -94,3 +103,15 @@ func (ingressClassStrategy) ValidateUpdate(ctx context.Context, obj, old runtime func (ingressClassStrategy) AllowUnconditionalUpdate() bool { return true } + +func scopeInUse(ingressClass *networking.IngressClass) bool { + return ingressClass.Spec.Parameters != nil && ingressClass.Spec.Parameters.Scope != nil +} + +// Drops Scope and Namespace field from IngressClass's parameters. +func dropIngressClassParametersReferenceScope(ingressClass *networking.IngressClass) { + if ingressClass.Spec.Parameters != nil { + ingressClass.Spec.Parameters.Scope = nil + ingressClass.Spec.Parameters.Namespace = nil + } +} diff --git a/pkg/registry/networking/ingressclass/strategy_test.go b/pkg/registry/networking/ingressclass/strategy_test.go index 1f504b4ae4e8..61c88e666140 100644 --- a/pkg/registry/networking/ingressclass/strategy_test.go +++ b/pkg/registry/networking/ingressclass/strategy_test.go @@ -19,9 +19,15 @@ package ingressclass import ( "testing" + apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" + utilfeature "k8s.io/apiserver/pkg/util/feature" + featuregatetesting "k8s.io/component-base/featuregate/testing" "k8s.io/kubernetes/pkg/apis/networking" + "k8s.io/kubernetes/pkg/features" + utilpointer "k8s.io/utils/pointer" ) func TestIngressClassStrategy(t *testing.T) { @@ -67,6 +73,285 @@ func TestIngressClassStrategy(t *testing.T) { } errs = Strategy.ValidateUpdate(ctx, &ingressClass, &ingressClass) if len(errs) == 0 { - t.Errorf("Unexpected error from update validation for IngressClass, got none") + t.Errorf("Expected error from update validation for IngressClass, got none") + } +} + +func TestIngressClassPrepareForCreate(t *testing.T) { + tests := []struct { + name string + original *networking.IngressClass + expected *networking.IngressClass + enableNamespaceScopedParamsGate bool + }{ + { + name: "cluster scope is removed when feature is not enabled", + original: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeCluster), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + enableNamespaceScopedParamsGate: false, + }, + { + name: "namespace scope and namespace fields are removed when feature is not enabled", + original: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + enableNamespaceScopedParamsGate: false, + }, + { + name: "cluster scope is not removed when feature is enabled", + original: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeCluster), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeCluster), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + { + name: "namespace scope and namespace fields are not removed when feature is enabled", + original: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + original := test.original + expected := test.expected + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IngressClassNamespacedParams, test.enableNamespaceScopedParamsGate)() + ctx := genericapirequest.NewDefaultContext() + Strategy.PrepareForCreate(ctx, runtime.Object(original)) + if !apiequality.Semantic.DeepEqual(original.Spec, expected.Spec) { + t.Errorf("got different than expected\ngot:\n\t%+v\nexpected:\n\t%+v", original.Spec, expected.Spec) + } + }) + } +} + +func TestIngressClassPrepareForUpdate(t *testing.T) { + tests := []struct { + name string + newIngressClass *networking.IngressClass + oldIngressClass *networking.IngressClass + expected *networking.IngressClass + enableNamespaceScopedParamsGate bool + }{ + { + name: "scope can be updated if already set when feature is disabled", + newIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + oldIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeCluster), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: false, + }, + { + name: "scope is removed if not already set previously when feature is disabled", + newIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + oldIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + enableNamespaceScopedParamsGate: false, + }, + { + name: "scope can be set when feature is enabled", + newIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + oldIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + { + name: "scope can be removed when feature is enabled", + newIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + oldIngressClass: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + Scope: utilpointer.StringPtr(networking.IngressClassParametersReferenceScopeNamespace), + Namespace: utilpointer.StringPtr("foo-ns"), + }, + }, + }, + expected: &networking.IngressClass{ + Spec: networking.IngressClassSpec{ + Controller: "controller", + Parameters: &networking.IngressClassParametersReference{ + Kind: "k", + Name: "n", + }, + }, + }, + enableNamespaceScopedParamsGate: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IngressClassNamespacedParams, test.enableNamespaceScopedParamsGate)() + ctx := genericapirequest.NewDefaultContext() + Strategy.PrepareForUpdate(ctx, runtime.Object(test.newIngressClass), runtime.Object(test.oldIngressClass)) + if !apiequality.Semantic.DeepEqual(test.newIngressClass.Spec, test.expected.Spec) { + t.Errorf("got different than expected\ngot:\n\t%+v\nexpected:\n\t%+v", test.newIngressClass.Spec, test.expected.Spec) + } + }) } } diff --git a/staging/src/k8s.io/api/networking/v1/generated.pb.go b/staging/src/k8s.io/api/networking/v1/generated.pb.go index b4963471e48c..719861b96ca5 100644 --- a/staging/src/k8s.io/api/networking/v1/generated.pb.go +++ b/staging/src/k8s.io/api/networking/v1/generated.pb.go @@ -244,10 +244,38 @@ func (m *IngressClassList) XXX_DiscardUnknown() { var xxx_messageInfo_IngressClassList proto.InternalMessageInfo +func (m *IngressClassParametersReference) Reset() { *m = IngressClassParametersReference{} } +func (*IngressClassParametersReference) ProtoMessage() {} +func (*IngressClassParametersReference) Descriptor() ([]byte, []int) { + return fileDescriptor_1c72867a70a7cc90, []int{7} +} +func (m *IngressClassParametersReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IngressClassParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IngressClassParametersReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_IngressClassParametersReference.Merge(m, src) +} +func (m *IngressClassParametersReference) XXX_Size() int { + return m.Size() +} +func (m *IngressClassParametersReference) XXX_DiscardUnknown() { + xxx_messageInfo_IngressClassParametersReference.DiscardUnknown(m) +} + +var xxx_messageInfo_IngressClassParametersReference proto.InternalMessageInfo + func (m *IngressClassSpec) Reset() { *m = IngressClassSpec{} } func (*IngressClassSpec) ProtoMessage() {} func (*IngressClassSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{7} + return fileDescriptor_1c72867a70a7cc90, []int{8} } func (m *IngressClassSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -275,7 +303,7 @@ var xxx_messageInfo_IngressClassSpec proto.InternalMessageInfo func (m *IngressList) Reset() { *m = IngressList{} } func (*IngressList) ProtoMessage() {} func (*IngressList) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{8} + return fileDescriptor_1c72867a70a7cc90, []int{9} } func (m *IngressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -303,7 +331,7 @@ var xxx_messageInfo_IngressList proto.InternalMessageInfo func (m *IngressRule) Reset() { *m = IngressRule{} } func (*IngressRule) ProtoMessage() {} func (*IngressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{9} + return fileDescriptor_1c72867a70a7cc90, []int{10} } func (m *IngressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -331,7 +359,7 @@ var xxx_messageInfo_IngressRule proto.InternalMessageInfo func (m *IngressRuleValue) Reset() { *m = IngressRuleValue{} } func (*IngressRuleValue) ProtoMessage() {} func (*IngressRuleValue) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{10} + return fileDescriptor_1c72867a70a7cc90, []int{11} } func (m *IngressRuleValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,7 +387,7 @@ var xxx_messageInfo_IngressRuleValue proto.InternalMessageInfo func (m *IngressServiceBackend) Reset() { *m = IngressServiceBackend{} } func (*IngressServiceBackend) ProtoMessage() {} func (*IngressServiceBackend) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{11} + return fileDescriptor_1c72867a70a7cc90, []int{12} } func (m *IngressServiceBackend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,7 +415,7 @@ var xxx_messageInfo_IngressServiceBackend proto.InternalMessageInfo func (m *IngressSpec) Reset() { *m = IngressSpec{} } func (*IngressSpec) ProtoMessage() {} func (*IngressSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{12} + return fileDescriptor_1c72867a70a7cc90, []int{13} } func (m *IngressSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +443,7 @@ var xxx_messageInfo_IngressSpec proto.InternalMessageInfo func (m *IngressStatus) Reset() { *m = IngressStatus{} } func (*IngressStatus) ProtoMessage() {} func (*IngressStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{13} + return fileDescriptor_1c72867a70a7cc90, []int{14} } func (m *IngressStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,7 +471,7 @@ var xxx_messageInfo_IngressStatus proto.InternalMessageInfo func (m *IngressTLS) Reset() { *m = IngressTLS{} } func (*IngressTLS) ProtoMessage() {} func (*IngressTLS) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{14} + return fileDescriptor_1c72867a70a7cc90, []int{15} } func (m *IngressTLS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,7 +499,7 @@ var xxx_messageInfo_IngressTLS proto.InternalMessageInfo func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } func (*NetworkPolicy) ProtoMessage() {} func (*NetworkPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{15} + return fileDescriptor_1c72867a70a7cc90, []int{16} } func (m *NetworkPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -499,7 +527,7 @@ var xxx_messageInfo_NetworkPolicy proto.InternalMessageInfo func (m *NetworkPolicyEgressRule) Reset() { *m = NetworkPolicyEgressRule{} } func (*NetworkPolicyEgressRule) ProtoMessage() {} func (*NetworkPolicyEgressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{16} + return fileDescriptor_1c72867a70a7cc90, []int{17} } func (m *NetworkPolicyEgressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +555,7 @@ var xxx_messageInfo_NetworkPolicyEgressRule proto.InternalMessageInfo func (m *NetworkPolicyIngressRule) Reset() { *m = NetworkPolicyIngressRule{} } func (*NetworkPolicyIngressRule) ProtoMessage() {} func (*NetworkPolicyIngressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{17} + return fileDescriptor_1c72867a70a7cc90, []int{18} } func (m *NetworkPolicyIngressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +583,7 @@ var xxx_messageInfo_NetworkPolicyIngressRule proto.InternalMessageInfo func (m *NetworkPolicyList) Reset() { *m = NetworkPolicyList{} } func (*NetworkPolicyList) ProtoMessage() {} func (*NetworkPolicyList) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{18} + return fileDescriptor_1c72867a70a7cc90, []int{19} } func (m *NetworkPolicyList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -583,7 +611,7 @@ var xxx_messageInfo_NetworkPolicyList proto.InternalMessageInfo func (m *NetworkPolicyPeer) Reset() { *m = NetworkPolicyPeer{} } func (*NetworkPolicyPeer) ProtoMessage() {} func (*NetworkPolicyPeer) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{19} + return fileDescriptor_1c72867a70a7cc90, []int{20} } func (m *NetworkPolicyPeer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -611,7 +639,7 @@ var xxx_messageInfo_NetworkPolicyPeer proto.InternalMessageInfo func (m *NetworkPolicyPort) Reset() { *m = NetworkPolicyPort{} } func (*NetworkPolicyPort) ProtoMessage() {} func (*NetworkPolicyPort) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{20} + return fileDescriptor_1c72867a70a7cc90, []int{21} } func (m *NetworkPolicyPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -639,7 +667,7 @@ var xxx_messageInfo_NetworkPolicyPort proto.InternalMessageInfo func (m *NetworkPolicySpec) Reset() { *m = NetworkPolicySpec{} } func (*NetworkPolicySpec) ProtoMessage() {} func (*NetworkPolicySpec) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{21} + return fileDescriptor_1c72867a70a7cc90, []int{22} } func (m *NetworkPolicySpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -667,7 +695,7 @@ var xxx_messageInfo_NetworkPolicySpec proto.InternalMessageInfo func (m *ServiceBackendPort) Reset() { *m = ServiceBackendPort{} } func (*ServiceBackendPort) ProtoMessage() {} func (*ServiceBackendPort) Descriptor() ([]byte, []int) { - return fileDescriptor_1c72867a70a7cc90, []int{22} + return fileDescriptor_1c72867a70a7cc90, []int{23} } func (m *ServiceBackendPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -700,6 +728,7 @@ func init() { proto.RegisterType((*IngressBackend)(nil), "k8s.io.api.networking.v1.IngressBackend") proto.RegisterType((*IngressClass)(nil), "k8s.io.api.networking.v1.IngressClass") proto.RegisterType((*IngressClassList)(nil), "k8s.io.api.networking.v1.IngressClassList") + proto.RegisterType((*IngressClassParametersReference)(nil), "k8s.io.api.networking.v1.IngressClassParametersReference") proto.RegisterType((*IngressClassSpec)(nil), "k8s.io.api.networking.v1.IngressClassSpec") proto.RegisterType((*IngressList)(nil), "k8s.io.api.networking.v1.IngressList") proto.RegisterType((*IngressRule)(nil), "k8s.io.api.networking.v1.IngressRule") @@ -723,98 +752,104 @@ func init() { } var fileDescriptor_1c72867a70a7cc90 = []byte{ - // 1455 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0x1b, 0x45, - 0x1c, 0xcf, 0x3a, 0x71, 0x9c, 0x8c, 0xd3, 0x34, 0x1d, 0x5a, 0x61, 0x15, 0x61, 0x87, 0x15, 0x6d, - 0x03, 0xa5, 0x6b, 0xe2, 0x56, 0x88, 0x1b, 0xb0, 0xe9, 0x2b, 0xe0, 0x26, 0xd6, 0xd8, 0x2a, 0x02, - 0x51, 0xd4, 0xf1, 0x7a, 0x62, 0x6f, 0xbd, 0xde, 0x59, 0x66, 0xc7, 0xa1, 0xbd, 0x71, 0xe1, 0xc0, - 0x8d, 0xaf, 0xc0, 0x81, 0x4f, 0x00, 0x37, 0x04, 0x85, 0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, 0xa4, 0x5f, 0xd3, 0x4e, 0x55, - 0xff, 0x55, 0x03, 0x1b, 0x49, 0xc1, 0xba, 0xed, 0x73, 0xf8, 0xc5, 0x44, 0x10, 0xc6, 0x7c, 0x41, - 0x08, 0x6d, 0x19, 0xc2, 0x86, 0x32, 0xb5, 0x12, 0x52, 0x12, 0x01, 0x7c, 0x02, 0xf2, 0x36, 0x27, - 0x03, 0x5f, 0xb6, 0x48, 0xb1, 0x76, 0x71, 0xbe, 0x08, 0xe2, 0xee, 0xdc, 0x15, 0xca, 0x28, 0xc0, - 0xd0, 0x7f, 0xcc, 0xf8, 0x2f, 0x42, 0x83, 0x35, 0x00, 0x2c, 0xea, 0x72, 0x46, 0x1d, 0x87, 0x84, - 0xdd, 0x1a, 0x25, 0x75, 0x27, 0xe2, 0xa0, 0x84, 0x14, 0xbc, 0x07, 0x80, 0x87, 0x19, 0x1e, 0x10, - 0x4e, 0x98, 0xaf, 0x92, 0xfb, 0x3f, 0x8b, 0x64, 0x5d, 0xc0, 0x37, 0x22, 0x10, 0x94, 0x00, 0xd4, - 0x7f, 0xd2, 0x40, 0x51, 0xf9, 0x79, 0x02, 0x29, 0xbe, 0x99, 0x4e, 0xf1, 0x1b, 0xb3, 0xc7, 0xed, - 0xf1, 0xd9, 0xfd, 0x21, 0xf6, 0x5a, 0x0c, 0x58, 0x31, 0x00, 0x7b, 0xd4, 0xe7, 0xd9, 0x01, 0x78, - 0x9b, 0xfa, 0x1c, 0x49, 0x0e, 0xf4, 0xc0, 0x86, 0x9d, 0x99, 0xc8, 0x73, 0x57, 0x6a, 0xa4, 0x61, - 0x96, 0x14, 0xf2, 0x46, 0x96, 0x83, 0x26, 0xd0, 0xf5, 0xfb, 0x60, 0x42, 0x4a, 0xf4, 0x48, 0x8f, - 0x73, 0xef, 0x98, 0xcc, 0x4e, 0x5f, 0x01, 0xb1, 0xf5, 0x15, 0x19, 0x53, 0xab, 0xd5, 0x40, 0x12, - 0x45, 0xff, 0x4e, 0x03,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x24, 0x64, 0xc5, 0x9d, 0xd7, 0x2f, 0x2d, 0xc9, - 0x45, 0xf5, 0x7a, 0x10, 0x6c, 0x44, 0x3e, 0x12, 0x97, 0xde, 0xe8, 0x13, 0x25, 0x35, 0xf4, 0x2f, - 0x01, 0x9c, 0xbc, 0xd7, 0xcc, 0x71, 0x6b, 0xba, 0x08, 0x96, 0xdd, 0xe1, 0xa0, 0x4d, 0x82, 0x1e, - 0xca, 0xc7, 0x0e, 0xee, 0x49, 0x2a, 0x52, 0x5c, 0x73, 0xeb, 0xc9, 0xf3, 0xf2, 0xc2, 0xd3, 0xe7, - 0xe5, 0x85, 0x67, 0xcf, 0xcb, 0x0b, 0xdf, 0x8c, 0xcb, 0xda, 0x93, 0x71, 0x59, 0x7b, 0x3a, 0x2e, - 0x6b, 0xcf, 0xc6, 0x65, 0xed, 0xef, 0x71, 0x59, 0xfb, 0xfe, 0x9f, 0xf2, 0xc2, 0xe7, 0xb9, 0xc3, - 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xb2, 0x4c, 0xf7, 0x73, 0x12, 0x00, 0x00, + // 1545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x1b, 0xcf, 0x3a, 0x71, 0xec, 0x3c, 0x4e, 0xd2, 0x74, 0xde, 0x56, 0xaf, 0xd5, 0x57, 0xaf, 0x1d, + 0x56, 0xb4, 0x0d, 0x94, 0xda, 0x24, 0xad, 0x10, 0x9c, 0xa0, 0x9b, 0xb6, 0x69, 0x68, 0x9a, 0x58, + 0x63, 0xab, 0x08, 0x04, 0xa8, 0x93, 0xf5, 0xc4, 0xd9, 0x7a, 0xbd, 0xb3, 0xcc, 0x8e, 0x43, 0x7b, + 0xe3, 0xc2, 0x81, 0x1b, 0xff, 0x02, 0x7f, 0x02, 0x82, 0x1b, 0x82, 0x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, 0x37, 0x27, 0x26, + 0x48, 0xf9, 0x35, 0xee, 0x54, 0xcd, 0x9f, 0x0d, 0x58, 0x49, 0x0b, 0xee, 0x38, 0x81, 0x40, 0x9f, + 0x8e, 0x04, 0x51, 0x99, 0x2e, 0x08, 0xa9, 0xad, 0x42, 0x58, 0xd1, 0xa6, 0xf2, 0x11, 0x25, 0x15, + 0xc0, 0x5d, 0xc8, 0x3a, 0x82, 0x76, 0x02, 0xd5, 0x22, 0x85, 0x8d, 0x4b, 0xd3, 0x45, 0x90, 0x74, + 0xe7, 0xb6, 0x54, 0xc6, 0x21, 0x86, 0xf9, 0xa7, 0x01, 0xe5, 0xb4, 0x58, 0x8d, 0x70, 0xd2, 0xa1, + 0x82, 0xf2, 0x20, 0x3e, 0x3c, 0xb4, 0x06, 0x79, 0x52, 0xdb, 0xde, 0xe2, 0xac, 0xeb, 0x47, 0xad, + 0x2b, 0x5d, 0xbb, 0xa1, 0x69, 0x38, 0xe6, 0xca, 0x06, 0x6f, 0x3b, 0x7a, 0x4a, 0xa5, 0x1a, 0xfc, + 0xae, 0xe3, 0x35, 0xb1, 0xe2, 0x48, 0x09, 0x8f, 0x74, 0xa2, 0xe1, 0x17, 0x4b, 0xec, 0x92, 0x0e, + 0xc5, 0x8a, 0x83, 0xca, 0x90, 0x0d, 0x6c, 0xe6, 0x87, 0x15, 0xbc, 0x60, 0x2d, 0x48, 0x97, 0xeb, + 0x92, 0x80, 0x43, 0x3a, 0xba, 0x02, 0x0b, 0x52, 0x30, 0xf0, 0x89, 0x4d, 0x8b, 0x59, 0x25, 0xb4, + 0xd4, 0xef, 0x95, 0x17, 0x76, 0x23, 0x22, 0x4e, 0xf8, 0xe6, 0xf7, 0x43, 0xe7, 0x23, 0x8f, 0x0e, + 0x6d, 0x00, 0xd8, 0xcc, 0x13, 0x9c, 0xb9, 0x2e, 0x8d, 0xa6, 0x51, 0x5c, 0x34, 0x9b, 0x31, 0x07, + 0xa7, 0xa4, 0x90, 0x03, 0xe0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00, 0x00, 0xff, + 0xff, 0xe9, 0x15, 0xcc, 0xab, 0x5f, 0x13, 0x00, 0x00, } func (m *HTTPIngressPath) Marshal() (dAtA []byte, err error) { @@ -1126,6 +1161,60 @@ func (m *IngressClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *IngressClassParametersReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IngressClassParametersReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IngressClassParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Namespace != nil { + i -= len(*m.Namespace) + copy(dAtA[i:], *m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Namespace))) + i-- + dAtA[i] = 0x2a + } + if m.Scope != nil { + i -= len(*m.Scope) + copy(dAtA[i:], *m.Scope) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Scope))) + i-- + dAtA[i] = 0x22 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + if m.APIGroup != nil { + i -= len(*m.APIGroup) + copy(dAtA[i:], *m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.APIGroup))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *IngressClassSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1985,6 +2074,31 @@ func (m *IngressClassList) Size() (n int) { return n } +func (m *IngressClassParametersReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.APIGroup != nil { + l = len(*m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Scope != nil { + l = len(*m.Scope) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Namespace != nil { + l = len(*m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *IngressClassSpec) Size() (n int) { if m == nil { return 0 @@ -2361,13 +2475,27 @@ func (this *IngressClassList) String() string { }, "") return s } +func (this *IngressClassParametersReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IngressClassParametersReference{`, + `APIGroup:` + valueToStringGenerated(this.APIGroup) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Scope:` + valueToStringGenerated(this.Scope) + `,`, + `Namespace:` + valueToStringGenerated(this.Namespace) + `,`, + `}`, + }, "") + return s +} func (this *IngressClassSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&IngressClassSpec{`, `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`, - `Parameters:` + strings.Replace(fmt.Sprintf("%v", this.Parameters), "TypedLocalObjectReference", "v11.TypedLocalObjectReference", 1) + `,`, + `Parameters:` + strings.Replace(this.Parameters.String(), "IngressClassParametersReference", "IngressClassParametersReference", 1) + `,`, `}`, }, "") return s @@ -3449,6 +3577,219 @@ func (m *IngressClassList) Unmarshal(dAtA []byte) error { } return nil } +func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IngressClassParametersReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IngressClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.APIGroup = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Scope = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Namespace = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *IngressClassSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3540,7 +3881,7 @@ func (m *IngressClassSpec) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Parameters == nil { - m.Parameters = &v11.TypedLocalObjectReference{} + m.Parameters = &IngressClassParametersReference{} } if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/staging/src/k8s.io/api/networking/v1/generated.proto b/staging/src/k8s.io/api/networking/v1/generated.proto index 02aa1fc1608b..8f23477d8fbc 100644 --- a/staging/src/k8s.io/api/networking/v1/generated.proto +++ b/staging/src/k8s.io/api/networking/v1/generated.proto @@ -150,6 +150,36 @@ message IngressClassList { repeated IngressClass items = 2; } +// IngressClassParametersReference identifies an API object. This can be used +// to specify a cluster or namespace-scoped resource. +message IngressClassParametersReference { + // APIGroup is the group for the resource being referenced. If APIGroup is + // not specified, the specified Kind must be in the core API group. For any + // other third-party types, APIGroup is required. + // +optional + optional string aPIGroup = 1; + + // Kind is the type of resource being referenced. + optional string kind = 2; + + // Name is the name of resource being referenced. + optional string name = 3; + + // Scope represents if this refers to a cluster or namespace scoped resource. + // This may be set to "Cluster" (default) or "Namespace". + // Field can be enabled with IngressClassNamespacedParams feature gate. + // +optional + // +featureGate=IngressClassNamespacedParams + optional string scope = 4; + + // Namespace is the namespace of the resource being referenced. This field is + // required when scope is set to "Namespace" and must be unset when scope is set to + // "Cluster". + // +optional + // +featureGate=IngressClassNamespacedParams + optional string namespace = 5; +} + // IngressClassSpec provides information about the class of an Ingress. message IngressClassSpec { // Controller refers to the name of the controller that should handle this @@ -164,7 +194,7 @@ message IngressClassSpec { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - optional k8s.io.api.core.v1.TypedLocalObjectReference parameters = 2; + optional IngressClassParametersReference parameters = 2; } // IngressList is a collection of Ingress. diff --git a/staging/src/k8s.io/api/networking/v1/types.go b/staging/src/k8s.io/api/networking/v1/types.go index 12731f0c6a0a..6cc210b8940f 100644 --- a/staging/src/k8s.io/api/networking/v1/types.go +++ b/staging/src/k8s.io/api/networking/v1/types.go @@ -508,7 +508,42 @@ type IngressClassSpec struct { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - Parameters *v1.TypedLocalObjectReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` + Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` +} + +const ( + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is namespace-scoped. + IngressClassParametersReferenceScopeNamespace = "Namespace" + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is cluster-scoped. + IngressClassParametersReferenceScopeCluster = "Cluster" +) + +// IngressClassParametersReference identifies an API object. This can be used +// to specify a cluster or namespace-scoped resource. +type IngressClassParametersReference struct { + // APIGroup is the group for the resource being referenced. If APIGroup is + // not specified, the specified Kind must be in the core API group. For any + // other third-party types, APIGroup is required. + // +optional + APIGroup *string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=aPIGroup"` + // Kind is the type of resource being referenced. + Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` + // Name is the name of resource being referenced. + Name string `json:"name" protobuf:"bytes,3,opt,name=name"` + // Scope represents if this refers to a cluster or namespace scoped resource. + // This may be set to "Cluster" (default) or "Namespace". + // Field can be enabled with IngressClassNamespacedParams feature gate. + // +optional + // +featureGate=IngressClassNamespacedParams + Scope *string `json:"scope" protobuf:"bytes,4,opt,name=scope"` + // Namespace is the namespace of the resource being referenced. This field is + // required when scope is set to "Namespace" and must be unset when scope is set to + // "Cluster". + // +optional + // +featureGate=IngressClassNamespacedParams + Namespace *string `json:"namespace,omitempty" protobuf:"bytes,5,opt,name=namespace"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go index bc84bd666dc8..88f9a8f130b2 100644 --- a/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go @@ -98,6 +98,19 @@ func (IngressClassList) SwaggerDoc() map[string]string { return map_IngressClassList } +var map_IngressClassParametersReference = map[string]string{ + "": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", + "apiGroup": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "kind": "Kind is the type of resource being referenced.", + "name": "Name is the name of resource being referenced.", + "scope": "Scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\". Field can be enabled with IngressClassNamespacedParams feature gate.", + "namespace": "Namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", +} + +func (IngressClassParametersReference) SwaggerDoc() map[string]string { + return map_IngressClassParametersReference +} + var map_IngressClassSpec = map[string]string{ "": "IngressClassSpec provides information about the class of an Ingress.", "controller": "Controller refers to the name of the controller that should handle this class. This allows for different \"flavors\" that are controlled by the same controller. For example, you may have different Parameters for the same implementing controller. This should be specified as a domain-prefixed path no more than 250 characters in length, e.g. \"acme.io/ingress-controller\". This field is immutable.", diff --git a/staging/src/k8s.io/api/networking/v1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/networking/v1/zz_generated.deepcopy.go index a68fb0f5415a..76e339aed9eb 100644 --- a/staging/src/k8s.io/api/networking/v1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/networking/v1/zz_generated.deepcopy.go @@ -207,12 +207,43 @@ func (in *IngressClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressClassParametersReference) DeepCopyInto(out *IngressClassParametersReference) { + *out = *in + if in.APIGroup != nil { + in, out := &in.APIGroup, &out.APIGroup + *out = new(string) + **out = **in + } + if in.Scope != nil { + in, out := &in.Scope, &out.Scope + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressClassParametersReference. +func (in *IngressClassParametersReference) DeepCopy() *IngressClassParametersReference { + if in == nil { + return nil + } + out := new(IngressClassParametersReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressClassSpec) DeepCopyInto(out *IngressClassSpec) { *out = *in if in.Parameters != nil { in, out := &in.Parameters, &out.Parameters - *out = new(corev1.TypedLocalObjectReference) + *out = new(IngressClassParametersReference) (*in).DeepCopyInto(*out) } return diff --git a/staging/src/k8s.io/api/networking/v1beta1/generated.pb.go b/staging/src/k8s.io/api/networking/v1beta1/generated.pb.go index fa921b619988..cda115147257 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/generated.pb.go +++ b/staging/src/k8s.io/api/networking/v1beta1/generated.pb.go @@ -212,10 +212,38 @@ func (m *IngressClassList) XXX_DiscardUnknown() { var xxx_messageInfo_IngressClassList proto.InternalMessageInfo +func (m *IngressClassParametersReference) Reset() { *m = IngressClassParametersReference{} } +func (*IngressClassParametersReference) ProtoMessage() {} +func (*IngressClassParametersReference) Descriptor() ([]byte, []int) { + return fileDescriptor_5bea11de0ceb8f53, []int{6} +} +func (m *IngressClassParametersReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IngressClassParametersReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IngressClassParametersReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_IngressClassParametersReference.Merge(m, src) +} +func (m *IngressClassParametersReference) XXX_Size() int { + return m.Size() +} +func (m *IngressClassParametersReference) XXX_DiscardUnknown() { + xxx_messageInfo_IngressClassParametersReference.DiscardUnknown(m) +} + +var xxx_messageInfo_IngressClassParametersReference proto.InternalMessageInfo + func (m *IngressClassSpec) Reset() { *m = IngressClassSpec{} } func (*IngressClassSpec) ProtoMessage() {} func (*IngressClassSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{6} + return fileDescriptor_5bea11de0ceb8f53, []int{7} } func (m *IngressClassSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -243,7 +271,7 @@ var xxx_messageInfo_IngressClassSpec proto.InternalMessageInfo func (m *IngressList) Reset() { *m = IngressList{} } func (*IngressList) ProtoMessage() {} func (*IngressList) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{7} + return fileDescriptor_5bea11de0ceb8f53, []int{8} } func (m *IngressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +299,7 @@ var xxx_messageInfo_IngressList proto.InternalMessageInfo func (m *IngressRule) Reset() { *m = IngressRule{} } func (*IngressRule) ProtoMessage() {} func (*IngressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{8} + return fileDescriptor_5bea11de0ceb8f53, []int{9} } func (m *IngressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -299,7 +327,7 @@ var xxx_messageInfo_IngressRule proto.InternalMessageInfo func (m *IngressRuleValue) Reset() { *m = IngressRuleValue{} } func (*IngressRuleValue) ProtoMessage() {} func (*IngressRuleValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{9} + return fileDescriptor_5bea11de0ceb8f53, []int{10} } func (m *IngressRuleValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -327,7 +355,7 @@ var xxx_messageInfo_IngressRuleValue proto.InternalMessageInfo func (m *IngressSpec) Reset() { *m = IngressSpec{} } func (*IngressSpec) ProtoMessage() {} func (*IngressSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{10} + return fileDescriptor_5bea11de0ceb8f53, []int{11} } func (m *IngressSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +383,7 @@ var xxx_messageInfo_IngressSpec proto.InternalMessageInfo func (m *IngressStatus) Reset() { *m = IngressStatus{} } func (*IngressStatus) ProtoMessage() {} func (*IngressStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{11} + return fileDescriptor_5bea11de0ceb8f53, []int{12} } func (m *IngressStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,7 +411,7 @@ var xxx_messageInfo_IngressStatus proto.InternalMessageInfo func (m *IngressTLS) Reset() { *m = IngressTLS{} } func (*IngressTLS) ProtoMessage() {} func (*IngressTLS) Descriptor() ([]byte, []int) { - return fileDescriptor_5bea11de0ceb8f53, []int{12} + return fileDescriptor_5bea11de0ceb8f53, []int{13} } func (m *IngressTLS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,6 +443,7 @@ func init() { proto.RegisterType((*IngressBackend)(nil), "k8s.io.api.networking.v1beta1.IngressBackend") proto.RegisterType((*IngressClass)(nil), "k8s.io.api.networking.v1beta1.IngressClass") proto.RegisterType((*IngressClassList)(nil), "k8s.io.api.networking.v1beta1.IngressClassList") + proto.RegisterType((*IngressClassParametersReference)(nil), "k8s.io.api.networking.v1beta1.IngressClassParametersReference") proto.RegisterType((*IngressClassSpec)(nil), "k8s.io.api.networking.v1beta1.IngressClassSpec") proto.RegisterType((*IngressList)(nil), "k8s.io.api.networking.v1beta1.IngressList") proto.RegisterType((*IngressRule)(nil), "k8s.io.api.networking.v1beta1.IngressRule") @@ -429,69 +458,75 @@ func init() { } var fileDescriptor_5bea11de0ceb8f53 = []byte{ - // 990 bytes of a gzipped FileDescriptorProto - 0x1f, 0x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d, 0x77, - 0x5b, 0x9e, 0x50, 0x0a, 0x98, 0x93, 0x7c, 0x5f, 0x3e, 0x21, 0x1c, 0x7c, 0x06, 0x42, 0xb5, 0xb3, - 0xb6, 0xf8, 0x84, 0x0c, 0x0a, 0x0b, 0xa9, 0x78, 0xb9, 0xc7, 0x17, 0x57, 0xe6, 0xc6, 0xf3, 0x2b, - 0x73, 0xe3, 0xc5, 0x95, 0xb9, 0xf1, 0xc3, 0xdc, 0x34, 0x2e, 0xe6, 0xa6, 0xf1, 0x7c, 0x6e, 0x1a, - 0x2f, 0xe6, 0xa6, 0xf1, 0xd7, 0xdc, 0x34, 0x7e, 0xfe, 0xdb, 0xdc, 0xf8, 0x6a, 0x4b, 0xd3, 0xf4, - 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x54, 0x4d, 0x9d, 0x25, 0x0b, 0x00, 0x00, + // 1085 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xae, 0x93, 0x66, 0x9b, 0x4e, 0xd2, 0x6e, 0x35, 0xf4, 0x10, 0x55, 0x22, 0xa9, 0x7c, 0x40, + 0x85, 0xa5, 0x36, 0xcd, 0x2e, 0x88, 0x13, 0x02, 0xaf, 0x04, 0xad, 0x36, 0x6c, 0xc3, 0x24, 0x02, + 0x84, 0x38, 0xec, 0xc4, 0x79, 0xeb, 0x98, 0x38, 0xb6, 0x99, 0x19, 0x07, 0xed, 0x8d, 0x2b, 0x27, + 0xf8, 0x15, 0xfc, 0x04, 0xc4, 0x11, 0xc1, 0xa5, 0xc7, 0x3d, 0xee, 0x85, 0x8a, 0x86, 0x7f, 0xc1, + 0x09, 0xcd, 0x78, 0x62, 0x3b, 0x49, 0xcb, 0xa6, 0x1c, 0xf6, 0x94, 0xcc, 0x7b, 0xdf, 0x7b, 0x6f, + 0xde, 0x7b, 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 0xc0, 0x9c, 0xa4, 0x72, 0x39, 0x53, 0x38, 0xb8, 0x0c, 0x84, 0x6a, 0x67, 0x69, 0x71, + 0xa6, 0xf4, 0x32, 0x0d, 0x29, 0xa0, 0x9c, 0xe3, 0x8b, 0xab, 0xe6, 0xc6, 0xf3, 0xab, 0xe6, 0xc6, + 0x8b, 0xab, 0xe6, 0xc6, 0xf7, 0xb3, 0xa6, 0x71, 0x31, 0x6b, 0x1a, 0xcf, 0x67, 0x4d, 0xe3, 0xc5, + 0xac, 0x69, 0xfc, 0x35, 0x6b, 0x1a, 0x3f, 0xfd, 0xdd, 0xdc, 0xf8, 0x6a, 0x4b, 0x97, 0xe9, 0xdf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x8b, 0x3b, 0x2e, 0x16, 0x0c, 0x00, 0x00, } func (m *HTTPIngressPath) Marshal() (dAtA []byte, err error) { @@ -769,6 +804,60 @@ func (m *IngressClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *IngressClassParametersReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IngressClassParametersReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IngressClassParametersReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Namespace != nil { + i -= len(*m.Namespace) + copy(dAtA[i:], *m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Namespace))) + i-- + dAtA[i] = 0x2a + } + if m.Scope != nil { + i -= len(*m.Scope) + copy(dAtA[i:], *m.Scope) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Scope))) + i-- + dAtA[i] = 0x22 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + if m.APIGroup != nil { + i -= len(*m.APIGroup) + copy(dAtA[i:], *m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.APIGroup))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *IngressClassSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1174,6 +1263,31 @@ func (m *IngressClassList) Size() (n int) { return n } +func (m *IngressClassParametersReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.APIGroup != nil { + l = len(*m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Scope != nil { + l = len(*m.Scope) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Namespace != nil { + l = len(*m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *IngressClassSpec) Size() (n int) { if m == nil { return 0 @@ -1373,13 +1487,27 @@ func (this *IngressClassList) String() string { }, "") return s } +func (this *IngressClassParametersReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IngressClassParametersReference{`, + `APIGroup:` + valueToStringGenerated(this.APIGroup) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Scope:` + valueToStringGenerated(this.Scope) + `,`, + `Namespace:` + valueToStringGenerated(this.Namespace) + `,`, + `}`, + }, "") + return s +} func (this *IngressClassSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&IngressClassSpec{`, `Controller:` + fmt.Sprintf("%v", this.Controller) + `,`, - `Parameters:` + strings.Replace(fmt.Sprintf("%v", this.Parameters), "TypedLocalObjectReference", "v11.TypedLocalObjectReference", 1) + `,`, + `Parameters:` + strings.Replace(this.Parameters.String(), "IngressClassParametersReference", "IngressClassParametersReference", 1) + `,`, `}`, }, "") return s @@ -2238,6 +2366,219 @@ func (m *IngressClassList) Unmarshal(dAtA []byte) error { } return nil } +func (m *IngressClassParametersReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IngressClassParametersReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IngressClassParametersReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.APIGroup = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Scope = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Namespace = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *IngressClassSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2329,7 +2670,7 @@ func (m *IngressClassSpec) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Parameters == nil { - m.Parameters = &v11.TypedLocalObjectReference{} + m.Parameters = &IngressClassParametersReference{} } if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/staging/src/k8s.io/api/networking/v1beta1/generated.proto b/staging/src/k8s.io/api/networking/v1beta1/generated.proto index 251bbafecf15..acb6e859cfcf 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/networking/v1beta1/generated.proto @@ -137,6 +137,36 @@ message IngressClassList { repeated IngressClass items = 2; } +// IngressClassParametersReference identifies an API object. This can be used +// to specify a cluster or namespace-scoped resource. +message IngressClassParametersReference { + // APIGroup is the group for the resource being referenced. If APIGroup is + // not specified, the specified Kind must be in the core API group. For any + // other third-party types, APIGroup is required. + // +optional + optional string aPIGroup = 1; + + // Kind is the type of resource being referenced. + optional string kind = 2; + + // Name is the name of resource being referenced. + optional string name = 3; + + // Scope represents if this refers to a cluster or namespace scoped resource. + // This may be set to "Cluster" (default) or "Namespace". + // Field can be enabled with IngressClassNamespacedParams feature gate. + // +optional + // +featureGate=IngressClassNamespacedParams + optional string scope = 4; + + // Namespace is the namespace of the resource being referenced. This field is + // required when scope is set to "Namespace" and must be unset when scope is set to + // "Cluster". + // +optional + // +featureGate=IngressClassNamespacedParams + optional string namespace = 5; +} + // IngressClassSpec provides information about the class of an Ingress. message IngressClassSpec { // Controller refers to the name of the controller that should handle this @@ -151,7 +181,7 @@ message IngressClassSpec { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - optional k8s.io.api.core.v1.TypedLocalObjectReference parameters = 2; + optional IngressClassParametersReference parameters = 2; } // IngressList is a collection of Ingress. diff --git a/staging/src/k8s.io/api/networking/v1beta1/types.go b/staging/src/k8s.io/api/networking/v1beta1/types.go index ef9bd4d67d67..09279d6938f5 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/types.go +++ b/staging/src/k8s.io/api/networking/v1beta1/types.go @@ -311,7 +311,42 @@ type IngressClassSpec struct { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - Parameters *v1.TypedLocalObjectReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` + Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` +} + +const ( + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is namespace-scoped. + IngressClassParametersReferenceScopeNamespace = "Namespace" + // IngressClassParametersReferenceScopeNamespace indicates that the + // referenced Parameters resource is cluster-scoped. + IngressClassParametersReferenceScopeCluster = "Cluster" +) + +// IngressClassParametersReference identifies an API object. This can be used +// to specify a cluster or namespace-scoped resource. +type IngressClassParametersReference struct { + // APIGroup is the group for the resource being referenced. If APIGroup is + // not specified, the specified Kind must be in the core API group. For any + // other third-party types, APIGroup is required. + // +optional + APIGroup *string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=aPIGroup"` + // Kind is the type of resource being referenced. + Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` + // Name is the name of resource being referenced. + Name string `json:"name" protobuf:"bytes,3,opt,name=name"` + // Scope represents if this refers to a cluster or namespace scoped resource. + // This may be set to "Cluster" (default) or "Namespace". + // Field can be enabled with IngressClassNamespacedParams feature gate. + // +optional + // +featureGate=IngressClassNamespacedParams + Scope *string `json:"scope" protobuf:"bytes,4,opt,name=scope"` + // Namespace is the namespace of the resource being referenced. This field is + // required when scope is set to "Namespace" and must be unset when scope is set to + // "Cluster". + // +optional + // +featureGate=IngressClassNamespacedParams + Namespace *string `json:"namespace,omitempty" protobuf:"bytes,5,opt,name=namespace"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/staging/src/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go index c774249d8ecb..84337ad3ea84 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go @@ -89,6 +89,19 @@ func (IngressClassList) SwaggerDoc() map[string]string { return map_IngressClassList } +var map_IngressClassParametersReference = map[string]string{ + "": "IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.", + "apiGroup": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", + "kind": "Kind is the type of resource being referenced.", + "name": "Name is the name of resource being referenced.", + "scope": "Scope represents if this refers to a cluster or namespace scoped resource. This may be set to \"Cluster\" (default) or \"Namespace\". Field can be enabled with IngressClassNamespacedParams feature gate.", + "namespace": "Namespace is the namespace of the resource being referenced. This field is required when scope is set to \"Namespace\" and must be unset when scope is set to \"Cluster\".", +} + +func (IngressClassParametersReference) SwaggerDoc() map[string]string { + return map_IngressClassParametersReference +} + var map_IngressClassSpec = map[string]string{ "": "IngressClassSpec provides information about the class of an Ingress.", "controller": "Controller refers to the name of the controller that should handle this class. This allows for different \"flavors\" that are controlled by the same controller. For example, you may have different Parameters for the same implementing controller. This should be specified as a domain-prefixed path no more than 250 characters in length, e.g. \"acme.io/ingress-controller\". This field is immutable.", diff --git a/staging/src/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go index d55ccde683d2..e1b4543d30a7 100644 --- a/staging/src/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/networking/v1beta1/zz_generated.deepcopy.go @@ -180,12 +180,43 @@ func (in *IngressClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressClassParametersReference) DeepCopyInto(out *IngressClassParametersReference) { + *out = *in + if in.APIGroup != nil { + in, out := &in.APIGroup, &out.APIGroup + *out = new(string) + **out = **in + } + if in.Scope != nil { + in, out := &in.Scope, &out.Scope + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressClassParametersReference. +func (in *IngressClassParametersReference) DeepCopy() *IngressClassParametersReference { + if in == nil { + return nil + } + out := new(IngressClassParametersReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngressClassSpec) DeepCopyInto(out *IngressClassSpec) { *out = *in if in.Parameters != nil { in, out := &in.Parameters, &out.Parameters - *out = new(v1.TypedLocalObjectReference) + *out = new(IngressClassParametersReference) (*in).DeepCopyInto(*out) } return diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.json b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.json index f7372554a8e1..b2b1a8cb48d9 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.json +++ b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.json @@ -45,7 +45,9 @@ "parameters": { "apiGroup": "20", "kind": "21", - "name": "22" + "name": "22", + "scope": "23", + "namespace": "24" } } } \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.pb b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.pb index 83a691231a117161cbc1c9ee4d77abb605467bd1..4713be19f6a56d01f894132bea9d5f34a37f5a55 100644 GIT binary patch delta 43 ycmey!_>*yhHsgtjI_u=6xR?wrg+#cRj0}XBj0~lijEt0+jEuFIj7+2$lo$Z>bO>z# delta 35 qcmey#_>pmfHsgVbI_t!RxR?wrg?PA_j0}XBj0~lijEtlhlo$Z6`3Eup diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.yaml b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.yaml index 1dab79b18dac..bda4f3c44301 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1.IngressClass.yaml @@ -35,3 +35,5 @@ spec: apiGroup: "20" kind: "21" name: "22" + namespace: "24" + scope: "23" diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.json b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.json index 1378dd2fc364..0bff037755aa 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.json +++ b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.json @@ -45,7 +45,9 @@ "parameters": { "apiGroup": "20", "kind": "21", - "name": "22" + "name": "22", + "scope": "23", + "namespace": "24" } } } \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.pb b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.pb index 368ca656d64218db012568bb9d2b162c9986db83..98d28cf34ff9b67cb947e1fcd80b36ef155c7a35 100644 GIT binary patch delta 43 ycmeyy_>Xad0pp2@hU?^|xR?wrg+#cRj0}XBj0~lijEt0+jEuFIj7+2$lo$Z^fCzyA delta 35 qcmeyz_>FOb0po#*hU>(IxR?wrg?PA_j0}XBj0~lijEtlhlo$Z9Wd}w8 diff --git a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.yaml b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.yaml index 75379e9dae19..397764aa420c 100644 --- a/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.yaml +++ b/staging/src/k8s.io/api/testdata/HEAD/networking.k8s.io.v1beta1.IngressClass.yaml @@ -35,3 +35,5 @@ spec: apiGroup: "20" kind: "21" name: "22" + namespace: "24" + scope: "23" diff --git a/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json new file mode 100644 index 000000000000..019f056cfba4 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json @@ -0,0 +1,52 @@ +{ + "kind": "IngressClass", + "apiVersion": "networking.k8s.io/v1", + "metadata": { + "name": "2", + "generateName": "3", + "namespace": "4", + "selfLink": "5", + "uid": "7", + "resourceVersion": "11042405498087606203", + "generation": 8071137005907523419, + "creationTimestamp": null, + "deletionGracePeriodSeconds": -4955867275792137171, + "labels": { + "7": "8" + }, + "annotations": { + "9": "10" + }, + "ownerReferences": [ + { + "apiVersion": "11", + "kind": "12", + "name": "13", + "uid": "Dz廔ȇ{sŊƏp", + "controller": false, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "14" + ], + "clusterName": "15", + "managedFields": [ + { + "manager": "16", + "operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]", + "apiVersion": "17", + "fieldsType": "18" + } + ] + }, + "spec": { + "controller": "19", + "parameters": { + "apiGroup": "20", + "kind": "21", + "name": "22", + "scope": null + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml new file mode 100644 index 000000000000..5f2287447cad --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + annotations: + "9": "10" + clusterName: "15" + creationTimestamp: null + deletionGracePeriodSeconds: -4955867275792137171 + finalizers: + - "14" + generateName: "3" + generation: 8071137005907523419 + labels: + "7": "8" + managedFields: + - apiVersion: "17" + fieldsType: "18" + manager: "16" + operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć] + name: "2" + namespace: "4" + ownerReferences: + - apiVersion: "11" + blockOwnerDeletion: true + controller: false + kind: "12" + name: "13" + uid: Dz廔ȇ{sŊƏp + resourceVersion: "11042405498087606203" + selfLink: "5" + uid: "7" +spec: + controller: "19" + parameters: + apiGroup: "20" + kind: "21" + name: "22" + scope: null diff --git a/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json new file mode 100644 index 000000000000..c1d246ea7b39 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json @@ -0,0 +1,52 @@ +{ + "kind": "IngressClass", + "apiVersion": "networking.k8s.io/v1beta1", + "metadata": { + "name": "2", + "generateName": "3", + "namespace": "4", + "selfLink": "5", + "uid": "7", + "resourceVersion": "11042405498087606203", + "generation": 8071137005907523419, + "creationTimestamp": null, + "deletionGracePeriodSeconds": -4955867275792137171, + "labels": { + "7": "8" + }, + "annotations": { + "9": "10" + }, + "ownerReferences": [ + { + "apiVersion": "11", + "kind": "12", + "name": "13", + "uid": "Dz廔ȇ{sŊƏp", + "controller": false, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "14" + ], + "clusterName": "15", + "managedFields": [ + { + "manager": "16", + "operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]", + "apiVersion": "17", + "fieldsType": "18" + } + ] + }, + "spec": { + "controller": "19", + "parameters": { + "apiGroup": "20", + "kind": "21", + "name": "22", + "scope": null + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml new file mode 100644 index 000000000000..38462c086608 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.19.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1beta1 +kind: IngressClass +metadata: + annotations: + "9": "10" + clusterName: "15" + creationTimestamp: null + deletionGracePeriodSeconds: -4955867275792137171 + finalizers: + - "14" + generateName: "3" + generation: 8071137005907523419 + labels: + "7": "8" + managedFields: + - apiVersion: "17" + fieldsType: "18" + manager: "16" + operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć] + name: "2" + namespace: "4" + ownerReferences: + - apiVersion: "11" + blockOwnerDeletion: true + controller: false + kind: "12" + name: "13" + uid: Dz廔ȇ{sŊƏp + resourceVersion: "11042405498087606203" + selfLink: "5" + uid: "7" +spec: + controller: "19" + parameters: + apiGroup: "20" + kind: "21" + name: "22" + scope: null diff --git a/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json new file mode 100644 index 000000000000..019f056cfba4 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.json @@ -0,0 +1,52 @@ +{ + "kind": "IngressClass", + "apiVersion": "networking.k8s.io/v1", + "metadata": { + "name": "2", + "generateName": "3", + "namespace": "4", + "selfLink": "5", + "uid": "7", + "resourceVersion": "11042405498087606203", + "generation": 8071137005907523419, + "creationTimestamp": null, + "deletionGracePeriodSeconds": -4955867275792137171, + "labels": { + "7": "8" + }, + "annotations": { + "9": "10" + }, + "ownerReferences": [ + { + "apiVersion": "11", + "kind": "12", + "name": "13", + "uid": "Dz廔ȇ{sŊƏp", + "controller": false, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "14" + ], + "clusterName": "15", + "managedFields": [ + { + "manager": "16", + "operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]", + "apiVersion": "17", + "fieldsType": "18" + } + ] + }, + "spec": { + "controller": "19", + "parameters": { + "apiGroup": "20", + "kind": "21", + "name": "22", + "scope": null + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml new file mode 100644 index 000000000000..5f2287447cad --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1.IngressClass.after_roundtrip.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + annotations: + "9": "10" + clusterName: "15" + creationTimestamp: null + deletionGracePeriodSeconds: -4955867275792137171 + finalizers: + - "14" + generateName: "3" + generation: 8071137005907523419 + labels: + "7": "8" + managedFields: + - apiVersion: "17" + fieldsType: "18" + manager: "16" + operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć] + name: "2" + namespace: "4" + ownerReferences: + - apiVersion: "11" + blockOwnerDeletion: true + controller: false + kind: "12" + name: "13" + uid: Dz廔ȇ{sŊƏp + resourceVersion: "11042405498087606203" + selfLink: "5" + uid: "7" +spec: + controller: "19" + parameters: + apiGroup: "20" + kind: "21" + name: "22" + scope: null diff --git a/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json new file mode 100644 index 000000000000..c1d246ea7b39 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.json @@ -0,0 +1,52 @@ +{ + "kind": "IngressClass", + "apiVersion": "networking.k8s.io/v1beta1", + "metadata": { + "name": "2", + "generateName": "3", + "namespace": "4", + "selfLink": "5", + "uid": "7", + "resourceVersion": "11042405498087606203", + "generation": 8071137005907523419, + "creationTimestamp": null, + "deletionGracePeriodSeconds": -4955867275792137171, + "labels": { + "7": "8" + }, + "annotations": { + "9": "10" + }, + "ownerReferences": [ + { + "apiVersion": "11", + "kind": "12", + "name": "13", + "uid": "Dz廔ȇ{sŊƏp", + "controller": false, + "blockOwnerDeletion": true + } + ], + "finalizers": [ + "14" + ], + "clusterName": "15", + "managedFields": [ + { + "manager": "16", + "operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]", + "apiVersion": "17", + "fieldsType": "18" + } + ] + }, + "spec": { + "controller": "19", + "parameters": { + "apiGroup": "20", + "kind": "21", + "name": "22", + "scope": null + } + } +} \ No newline at end of file diff --git a/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml new file mode 100644 index 000000000000..38462c086608 --- /dev/null +++ b/staging/src/k8s.io/api/testdata/v1.20.0/networking.k8s.io.v1beta1.IngressClass.after_roundtrip.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1beta1 +kind: IngressClass +metadata: + annotations: + "9": "10" + clusterName: "15" + creationTimestamp: null + deletionGracePeriodSeconds: -4955867275792137171 + finalizers: + - "14" + generateName: "3" + generation: 8071137005907523419 + labels: + "7": "8" + managedFields: + - apiVersion: "17" + fieldsType: "18" + manager: "16" + operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć] + name: "2" + namespace: "4" + ownerReferences: + - apiVersion: "11" + blockOwnerDeletion: true + controller: false + kind: "12" + name: "13" + uid: Dz廔ȇ{sŊƏp + resourceVersion: "11042405498087606203" + selfLink: "5" + uid: "7" +spec: + controller: "19" + parameters: + apiGroup: "20" + kind: "21" + name: "22" + scope: null diff --git a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassparametersreference.go b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassparametersreference.go new file mode 100644 index 000000000000..a020d3a8df87 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassparametersreference.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// IngressClassParametersReferenceApplyConfiguration represents an declarative configuration of the IngressClassParametersReference type for use +// with apply. +type IngressClassParametersReferenceApplyConfiguration struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Scope *string `json:"scope,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// IngressClassParametersReferenceApplyConfiguration constructs an declarative configuration of the IngressClassParametersReference type for use with +// apply. +func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { + return &IngressClassParametersReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *IngressClassParametersReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithKind(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithName(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithScope sets the Scope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scope field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithScope(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Scope = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithNamespace(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassspec.go b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassspec.go index 219c908b19a7..ec0423e708df 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassspec.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1/ingressclassspec.go @@ -18,15 +18,11 @@ limitations under the License. package v1 -import ( - v1 "k8s.io/client-go/applyconfigurations/core/v1" -) - // IngressClassSpecApplyConfiguration represents an declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { - Controller *string `json:"controller,omitempty"` - Parameters *v1.TypedLocalObjectReferenceApplyConfiguration `json:"parameters,omitempty"` + Controller *string `json:"controller,omitempty"` + Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } // IngressClassSpecApplyConfiguration constructs an declarative configuration of the IngressClassSpec type for use with @@ -46,7 +42,7 @@ func (b *IngressClassSpecApplyConfiguration) WithController(value string) *Ingre // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. -func (b *IngressClassSpecApplyConfiguration) WithParameters(value *v1.TypedLocalObjectReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { +func (b *IngressClassSpecApplyConfiguration) WithParameters(value *IngressClassParametersReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { b.Parameters = value return b } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go new file mode 100644 index 000000000000..e6ca805e4721 --- /dev/null +++ b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// IngressClassParametersReferenceApplyConfiguration represents an declarative configuration of the IngressClassParametersReference type for use +// with apply. +type IngressClassParametersReferenceApplyConfiguration struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Scope *string `json:"scope,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// IngressClassParametersReferenceApplyConfiguration constructs an declarative configuration of the IngressClassParametersReference type for use with +// apply. +func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { + return &IngressClassParametersReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *IngressClassParametersReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithKind(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithName(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithScope sets the Scope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scope field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithScope(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Scope = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *IngressClassParametersReferenceApplyConfiguration) WithNamespace(value string) *IngressClassParametersReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassspec.go b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassspec.go index eeaaac0689ea..51040462cae0 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassspec.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclassspec.go @@ -18,15 +18,11 @@ limitations under the License. package v1beta1 -import ( - v1 "k8s.io/client-go/applyconfigurations/core/v1" -) - // IngressClassSpecApplyConfiguration represents an declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { - Controller *string `json:"controller,omitempty"` - Parameters *v1.TypedLocalObjectReferenceApplyConfiguration `json:"parameters,omitempty"` + Controller *string `json:"controller,omitempty"` + Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } // IngressClassSpecApplyConfiguration constructs an declarative configuration of the IngressClassSpec type for use with @@ -46,7 +42,7 @@ func (b *IngressClassSpecApplyConfiguration) WithController(value string) *Ingre // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. -func (b *IngressClassSpecApplyConfiguration) WithParameters(value *v1.TypedLocalObjectReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { +func (b *IngressClassSpecApplyConfiguration) WithParameters(value *IngressClassParametersReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { b.Parameters = value return b } diff --git a/staging/src/k8s.io/client-go/applyconfigurations/utils.go b/staging/src/k8s.io/client-go/applyconfigurations/utils.go index 2723f3d7591e..d529112da4fe 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/utils.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/utils.go @@ -1033,6 +1033,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1.IngressBackendApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressClass"): return &applyconfigurationsnetworkingv1.IngressClassApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): + return &applyconfigurationsnetworkingv1.IngressClassParametersReferenceApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressClassSpec"): return &applyconfigurationsnetworkingv1.IngressClassSpecApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressRule"): @@ -1075,6 +1077,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1beta1.IngressBackendApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClass"): return &applyconfigurationsnetworkingv1beta1.IngressClassApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): + return &applyconfigurationsnetworkingv1beta1.IngressClassParametersReferenceApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassSpec"): return &applyconfigurationsnetworkingv1beta1.IngressClassSpecApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressRule"): diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go index 9ec40285aadf..dbb5de886ede 100644 --- a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go +++ b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go @@ -4024,7 +4024,7 @@ Parameters: }, Spec: networkingv1beta1.IngressClassSpec{ Controller: "example.com/controller", - Parameters: &corev1.TypedLocalObjectReference{ + Parameters: &networkingv1beta1.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("v1"), Kind: "ConfigMap", Name: "example-parameters", @@ -4040,7 +4040,7 @@ Parameters: }, Spec: networkingv1.IngressClassSpec{ Controller: "example.com/controller", - Parameters: &corev1.TypedLocalObjectReference{ + Parameters: &networkingv1.IngressClassParametersReference{ APIGroup: utilpointer.StringPtr("v1"), Kind: "ConfigMap", Name: "example-parameters",