Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing committed Apr 12, 2024
1 parent b6cc5a6 commit 64b76a9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions api/v1alpha1/envoyextensionypolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions internal/gatewayapi/envoyextensionpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/kubernetes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/kubernetes/indexers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<br />is being attached to.<br />This Policy and the TargetRef MUST be in the same namespace<br />for this Policy to have effect and be applied to the Gateway.<br />TargetRef |
| `wasm` | _[Wasm](#wasm) array_ | false | Wasm is a list of Wasm extensions to be loaded by the Gateway.<br />Order matters, as the extensions will be loaded in the order they are<br />defined in this list. |
| `extProc` | _[ExtProc](#extproc) array_ | true | ExtProc is an ordered list of external processing filters<br />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.<br />Order matters, as the extensions will be loaded in the order they are<br />defined in this list. |
| `extProc` | _[ExtProc](#extproc) array_ | true | ExtProcs is an ordered list of external processing filters<br />that should added to the envoy filter chain |


#### EnvoyGateway
Expand Down

0 comments on commit 64b76a9

Please sign in to comment.