Skip to content

Commit

Permalink
chore: add "extproc" to extproc ir name (envoyproxy#3697)
Browse files Browse the repository at this point in the history
add "extproc" to extproc ir name

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing authored and guydc committed Jul 1, 2024
1 parent a902613 commit 2d3e6f7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
11 changes: 5 additions & 6 deletions internal/gatewayapi/envoyextensionpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (t *Translator) buildExtProcs(policy *egv1a1.EnvoyExtensionPolicy, resource
}

for idx, ep := range policy.Spec.ExtProc {
name := irConfigNameForEEP(policy, idx)
name := irConfigNameForExtProc(policy, idx)
extProcIR, err := t.buildExtProc(name, utils.NamespacedName(policy), ep, idx, resources, envoyProxy)
if err != nil {
return nil, err
Expand Down Expand Up @@ -534,12 +534,11 @@ func (t *Translator) buildExtProc(
return extProcIR, err
}

func irConfigNameForEEP(policy *egv1a1.EnvoyExtensionPolicy, idx int) string {
func irConfigNameForExtProc(policy *egv1a1.EnvoyExtensionPolicy, index int) string {
return fmt.Sprintf(
"%s/%s/%d",
strings.ToLower(egv1a1.KindEnvoyExtensionPolicy),
utils.NamespacedName(policy).String(),
idx)
"%s/extproc/%s",
irConfigName(policy),
strconv.Itoa(index))
}

func (t *Translator) buildWasms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ xdsIR:
settings:
- protocol: GRPC
weight: 1
name: envoyextensionpolicy/default/policy-for-route-1/0
name: envoyextensionpolicy/default/policy-for-route-1/extproc/0
hostname: gateway.envoyproxy.io
isHTTP2: false
metadata:
Expand Down Expand Up @@ -263,7 +263,7 @@ xdsIR:
settings:
- protocol: GRPC
weight: 1
name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
hostname: gateway.envoyproxy.io
isHTTP2: false
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ xdsIR:
name: policy-btls-grpc-2/default-ca
sni: grpc-backend-2
weight: 1
name: envoyextensionpolicy/default/policy-for-http-route/0
name: envoyextensionpolicy/default/policy-for-http-route/extproc/0
requestHeaderProcessing: true
responseHeaderProcessing: true
hostname: www.foo.com
Expand Down Expand Up @@ -358,7 +358,7 @@ xdsIR:
weight: 1
failOpen: true
messageTimeout: 5s
name: envoyextensionpolicy/default/policy-for-gateway/0
name: envoyextensionpolicy/default/policy-for-gateway/extproc/0
requestBodyProcessingMode: Buffered
requestHeaderProcessing: true
responseBodyProcessingMode: Streamed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ xdsIR:
name: policy-btls-backend-ip/envoy-gateway-ca
sni: ip-backend
weight: 1
name: envoyextensionpolicy/default/policy-for-http-route/0
name: envoyextensionpolicy/default/policy-for-http-route/extproc/0
hostname: www.foo.com
isHTTP2: false
metadata:
Expand Down
8 changes: 4 additions & 4 deletions internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ http:
protocol: HTTP
weight: 1
extProc:
- name: envoyextensionpolicy/default/policy-for-route-2/0
- name: envoyextensionpolicy/default/policy-for-route-2/extproc/0
failOpen: true
messageTimeout: 5s
requestHeaderProcessing: true
Expand All @@ -31,7 +31,7 @@ http:
settings:
- protocol: GRPC
weight: 1
- name: envoyextensionpolicy/default/policy-for-route-1/0
- name: envoyextensionpolicy/default/policy-for-route-1/extproc/0
failOpen: true
messageTimeout: 5s
responseHeaderProcessing: true
Expand Down Expand Up @@ -59,14 +59,14 @@ http:
protocol: HTTP
weight: 1
extProc:
- name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0
- name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0
authority: grpc-backend-3.envoy-gateway:3000
destination:
name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0/grpc-backend-3
settings:
- protocol: GRPC
weight: 1
- name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
- name: envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
failOpen: false
messageTimeout: 15s
authority: grpc-backend.envoy-gateway:9000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
maxConcurrentStreams: 100
httpFilters:
- disabled: true
name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/0
name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/extproc/0
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
failureModeAllow: true
Expand All @@ -33,7 +33,7 @@
responseHeaderMode: SKIP
responseTrailerMode: SKIP
- disabled: true
name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/0
name: envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/extproc/0
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
failureModeAllow: true
Expand All @@ -50,7 +50,7 @@
responseHeaderMode: SEND
responseTrailerMode: SKIP
- disabled: true
name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0
name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
grpcService:
Expand All @@ -64,7 +64,7 @@
responseHeaderMode: SKIP
responseTrailerMode: SKIP
- disabled: true
name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0
name: envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
grpcService:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
upgradeConfigs:
- upgradeType: websocket
typedPerFilterConfig:
envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/0:
envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-1/extproc/0:
'@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
config: {}
envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/0:
envoy.filters.http.ext_proc/envoyextensionpolicy/default/policy-for-route-2/extproc/0:
'@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
config: {}
- match:
Expand All @@ -27,9 +27,9 @@
upgradeConfigs:
- upgradeType: websocket
typedPerFilterConfig:
envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/0:
envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-1/extproc/0:
'@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
config: {}
envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/0:
envoy.filters.http.ext_proc/envoyextensionpolicy/envoy-gateway/policy-for-gateway-2/extproc/0:
'@type': type.googleapis.com/envoy.config.route.v3.FilterConfig
config: {}

0 comments on commit 2d3e6f7

Please sign in to comment.