From d1660eea97d080794f68d6b58662f9241f5351ac Mon Sep 17 00:00:00 2001 From: Guy Daich Date: Wed, 3 Apr 2024 18:14:28 -0500 Subject: [PATCH] fix metadata options Signed-off-by: Guy Daich --- api/v1alpha1/ext_proc_types.go | 4 +- api/v1alpha1/zz_generated.deepcopy.go | 16 +------ ....envoyproxy.io_envoyextensionpolicies.yaml | 44 ++++++++----------- site/content/en/latest/api/extension_types.md | 4 +- 4 files changed, 24 insertions(+), 44 deletions(-) diff --git a/api/v1alpha1/ext_proc_types.go b/api/v1alpha1/ext_proc_types.go index 36cc1b1e5aa..6be4186a07a 100644 --- a/api/v1alpha1/ext_proc_types.go +++ b/api/v1alpha1/ext_proc_types.go @@ -83,12 +83,12 @@ type ExtProcMetadataOptions struct { // metadata namespaces forwarded to external processor // // +optional - ForwardingNamespaces []MetadataNamespaces `json:"forwardingNamespaces,omitempty"` + ForwardingNamespaces MetadataNamespaces `json:"forwardingNamespaces,omitempty"` // metadata namespaces updatable by external processor // // +optional - ReceivingNamespaces []MetadataNamespaces `json:"receivingNamespaces,omitempty"` + ReceivingNamespaces MetadataNamespaces `json:"receivingNamespaces,omitempty"` } // +kubebuilder:validation:XValidation:rule="has(self.backendRef) ? (!has(self.backendRef.group) || self.backendRef.group == \"\") : true", message="group is invalid, only the core API group (specified by omitting the group field or setting it to an empty string) is supported" diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 652218e15f7..896b182b9aa 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1571,20 +1571,8 @@ func (in *ExtProcBackendRef) DeepCopy() *ExtProcBackendRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExtProcMetadataOptions) DeepCopyInto(out *ExtProcMetadataOptions) { *out = *in - if in.ForwardingNamespaces != nil { - in, out := &in.ForwardingNamespaces, &out.ForwardingNamespaces - *out = make([]MetadataNamespaces, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ReceivingNamespaces != nil { - in, out := &in.ReceivingNamespaces, &out.ReceivingNamespaces - *out = make([]MetadataNamespaces, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } + in.ForwardingNamespaces.DeepCopyInto(&out.ForwardingNamespaces) + in.ReceivingNamespaces.DeepCopyInto(&out.ReceivingNamespaces) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtProcMetadataOptions. diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index c0b70836bc7..a5b95b11bfe 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -169,34 +169,26 @@ spec: properties: forwardingNamespaces: description: metadata namespaces forwarded to external processor - items: - description: MetadataNamespaces defines metadata namespaces - that can be used to forward or receive dynamic metadata - properties: - untyped: - description: |- - Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service - as an opaque protobuf::Struct. - items: - type: string - type: array - type: object - type: array + properties: + untyped: + description: |- + Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service + as an opaque protobuf::Struct. + items: + type: string + type: array + type: object receivingNamespaces: description: metadata namespaces updatable by external processor - items: - description: MetadataNamespaces defines metadata namespaces - that can be used to forward or receive dynamic metadata - properties: - untyped: - description: |- - Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service - as an opaque protobuf::Struct. - items: - type: string - type: array - type: object - type: array + properties: + untyped: + description: |- + Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service + as an opaque protobuf::Struct. + items: + type: string + type: array + type: object type: object processingMode: description: |- diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 045a608cc50..8e6895d30b0 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -1094,8 +1094,8 @@ _Appears in:_ | Field | Type | Required | Description | | --- | --- | --- | --- | -| `forwardingNamespaces` | _[MetadataNamespaces](#metadatanamespaces) array_ | false | metadata namespaces forwarded to external processor | -| `receivingNamespaces` | _[MetadataNamespaces](#metadatanamespaces) array_ | false | metadata namespaces updatable by external processor | +| `forwardingNamespaces` | _[MetadataNamespaces](#metadatanamespaces)_ | false | metadata namespaces forwarded to external processor | +| `receivingNamespaces` | _[MetadataNamespaces](#metadatanamespaces)_ | false | metadata namespaces updatable by external processor | #### ExtProcProcessingMode