diff --git a/api/v1alpha1/envoyextensionypolicy_types.go b/api/v1alpha1/envoyextensionypolicy_types.go index 6cee71c8d2d..f6fcac10986 100644 --- a/api/v1alpha1/envoyextensionypolicy_types.go +++ b/api/v1alpha1/envoyextensionypolicy_types.go @@ -46,16 +46,16 @@ type EnvoyExtensionPolicySpec struct { // TargetRef TargetRef gwapiv1a2.PolicyTargetReferenceWithSectionName `json:"targetRef"` - // Wasm is a list of Wasm extensions to be loaded by the Gateway. + // Wasms is a list of Wasm extensions to be loaded by the Gateway. // Order matters, as the extensions will be loaded in the order they are // defined in this list. // // +optional - Wasm []Wasm `json:"wasm,omitempty"` + Wasms []Wasm `json:"wasm,omitempty"` - // ExtProc is an ordered list of external processing filters + // ExtProcs is an ordered list of external processing filters // that should added to the envoy filter chain - ExtProc []ExtProc `json:"extProc,omitempty"` + ExtProcs []ExtProc `json:"extProc,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index d47c85c67aa..226b3ac8ce3 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -782,15 +782,15 @@ func (in *EnvoyExtensionPolicyList) DeepCopyObject() runtime.Object { func (in *EnvoyExtensionPolicySpec) DeepCopyInto(out *EnvoyExtensionPolicySpec) { *out = *in in.TargetRef.DeepCopyInto(&out.TargetRef) - if in.Wasm != nil { - in, out := &in.Wasm, &out.Wasm + if in.Wasms != nil { + in, out := &in.Wasms, &out.Wasms *out = make([]Wasm, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.ExtProc != nil { - in, out := &in.ExtProc, &out.ExtProc + if in.ExtProcs != nil { + in, out := &in.ExtProcs, &out.ExtProcs *out = make([]ExtProc, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) 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 53e1c1e203e..7785472b151 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -51,7 +51,7 @@ spec: properties: extProc: description: |- - ExtProc is an ordered list of external processing filters + ExtProcs is an ordered list of external processing filters that should added to the envoy filter chain items: description: ExtProc defines the configuration for External Processing @@ -215,7 +215,7 @@ spec: rule: '!has(self.sectionName)' wasm: description: |- - Wasm is a list of Wasm extensions to be loaded by the Gateway. + Wasms is a list of Wasm extensions to be loaded by the Gateway. Order matters, as the extensions will be loaded in the order they are defined in this list. items: diff --git a/internal/gatewayapi/envoyextensionpolicy.go b/internal/gatewayapi/envoyextensionpolicy.go index 5c02f6e7de3..a02d452c879 100644 --- a/internal/gatewayapi/envoyextensionpolicy.go +++ b/internal/gatewayapi/envoyextensionpolicy.go @@ -331,7 +331,7 @@ func (t *Translator) buildExtProcs(policy *egv1a1.EnvoyExtensionPolicy, resource return nil, nil } - for idx, ep := range policy.Spec.ExtProc { + for idx, ep := range policy.Spec.ExtProcs { name := irConfigNameForEEP(policy, idx) extProcIR, err := t.buildExtProc(name, utils.NamespacedName(policy), ep, idx, resources) if err != nil { @@ -460,7 +460,7 @@ func (t *Translator) buildWasms(policy *egv1a1.EnvoyExtensionPolicy) ([]ir.Wasm, return nil, nil } - for idx, wasm := range policy.Spec.Wasm { + for idx, wasm := range policy.Spec.Wasms { name := irConfigNameForEEP(policy, idx) wasmIR, err := t.buildWasm(name, wasm) if err != nil { diff --git a/internal/provider/kubernetes/controller.go b/internal/provider/kubernetes/controller.go index 571a45c5764..20ddc4ce650 100644 --- a/internal/provider/kubernetes/controller.go +++ b/internal/provider/kubernetes/controller.go @@ -1469,7 +1469,7 @@ func (r *gatewayAPIReconciler) processEnvoyExtensionPolicyObjectRefs( // to IR because the referenced service can't be found. for _, policy := range resourceTree.EnvoyExtensionPolicies { // Add the referenced BackendRefs and ReferenceGrants in ExtAuth to Maps for later processing - for _, ep := range policy.Spec.ExtProc { + for _, ep := range policy.Spec.ExtProcs { backendRef := ep.BackendRef.BackendObjectReference backendNamespace := gatewayapi.NamespaceDerefOr(backendRef.Namespace, policy.Namespace) diff --git a/internal/provider/kubernetes/indexers.go b/internal/provider/kubernetes/indexers.go index ac1132b31d5..831c0b24a70 100644 --- a/internal/provider/kubernetes/indexers.go +++ b/internal/provider/kubernetes/indexers.go @@ -534,7 +534,7 @@ func backendEnvoyExtensionPolicyIndexFunc(rawObj client.Object) []string { var ret []string - for _, ep := range envoyExtensionPolicy.Spec.ExtProc { + for _, ep := range envoyExtensionPolicy.Spec.ExtProcs { backendRef := ep.BackendRef.BackendObjectReference ret = append(ret, types.NamespacedName{ diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 358dbbac113..57025c6e9df 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -562,8 +562,8 @@ _Appears in:_ | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetRef` | _[PolicyTargetReferenceWithSectionName](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1alpha2.PolicyTargetReferenceWithSectionName)_ | true | TargetRef is the name of the Gateway resource this policy
is being attached to.
This Policy and the TargetRef MUST be in the same namespace
for this Policy to have effect and be applied to the Gateway.
TargetRef | -| `wasm` | _[Wasm](#wasm) array_ | false | Wasm is a list of Wasm extensions to be loaded by the Gateway.
Order matters, as the extensions will be loaded in the order they are
defined in this list. | -| `extProc` | _[ExtProc](#extproc) array_ | true | ExtProc is an ordered list of external processing filters
that should added to the envoy filter chain | +| `wasm` | _[Wasm](#wasm) array_ | false | Wasms is a list of Wasm extensions to be loaded by the Gateway.
Order matters, as the extensions will be loaded in the order they are
defined in this list. | +| `extProc` | _[ExtProc](#extproc) array_ | true | ExtProcs is an ordered list of external processing filters
that should added to the envoy filter chain | #### EnvoyGateway