From 2a1b77885e7c0fe0353a61bc9533aad8465e68dc Mon Sep 17 00:00:00 2001 From: huabing zhao Date: Thu, 14 Mar 2024 15:59:56 +0800 Subject: [PATCH] address comments Signed-off-by: huabing zhao --- .../testdata/out/xds-ir/basic-auth.listeners.yaml | 2 +- .../translator/testdata/out/xds-ir/basic-auth.routes.yaml | 2 +- .../translator/testdata/out/xds-ir/ext-auth.listeners.yaml | 4 ++-- .../xds/translator/testdata/out/xds-ir/ext-auth.routes.yaml | 6 +++--- .../xds/translator/testdata/out/xds-ir/oidc.listeners.yaml | 4 ++-- .../xds/translator/testdata/out/xds-ir/oidc.routes.yaml | 4 ++-- internal/xds/translator/utils.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml index 3b72788ce31..36ab0dbb7ba 100644 --- a/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/basic-auth.listeners.yaml @@ -15,7 +15,7 @@ maxConcurrentStreams: 100 httpFilters: - disabled: true - name: envoy.filters.http.basic_auth_first-route + name: envoy.filters.http.basic_auth/first-route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.basic_auth.v3.BasicAuth users: diff --git a/internal/xds/translator/testdata/out/xds-ir/basic-auth.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/basic-auth.routes.yaml index f87be11474a..22938d503e2 100644 --- a/internal/xds/translator/testdata/out/xds-ir/basic-auth.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/basic-auth.routes.yaml @@ -13,6 +13,6 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.basic_auth_first-route: + envoy.filters.http.basic_auth/first-route: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml index b5a0c93fe68..1fa830a1f83 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ext-auth.listeners.yaml @@ -15,7 +15,7 @@ maxConcurrentStreams: 100 httpFilters: - disabled: true - name: envoy.filters.http.ext_authz_default/httproute-1 + name: envoy.filters.http.ext_authz/default/httproute-1 typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz httpService: @@ -30,7 +30,7 @@ uri: http://http-backend.envoy-gateway:80/auth transportApiVersion: V3 - disabled: true - name: envoy.filters.http.ext_authz_default/gateway-1 + name: envoy.filters.http.ext_authz/default/gateway-1 typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz allowedHeaders: diff --git a/internal/xds/translator/testdata/out/xds-ir/ext-auth.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ext-auth.routes.yaml index d16f9a43047..7ca5275220c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ext-auth.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ext-auth.routes.yaml @@ -13,7 +13,7 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.ext_authz_default/httproute-1: + envoy.filters.http.ext_authz/default/httproute-1: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} - match: @@ -24,7 +24,7 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.ext_authz_default/httproute-1: + envoy.filters.http.ext_authz/default/httproute-1: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} - match: @@ -35,6 +35,6 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.ext_authz_default/gateway-1: + envoy.filters.http.ext_authz/default/gateway-1: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml index 73388e331ed..132b1d06a48 100644 --- a/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/oidc.listeners.yaml @@ -15,7 +15,7 @@ maxConcurrentStreams: 100 httpFilters: - disabled: true - name: envoy.filters.http.oauth2_first-route + name: envoy.filters.http.oauth2/first-route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.oauth2.v3.OAuth2 config: @@ -56,7 +56,7 @@ timeout: 10s uri: https://oauth.foo.com/token - disabled: true - name: envoy.filters.http.oauth2_second-route + name: envoy.filters.http.oauth2/second-route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.oauth2.v3.OAuth2 config: diff --git a/internal/xds/translator/testdata/out/xds-ir/oidc.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/oidc.routes.yaml index a093d6967ac..d597d98514e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/oidc.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/oidc.routes.yaml @@ -13,7 +13,7 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.oauth2_first-route: + envoy.filters.http.oauth2/first-route: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} - match: @@ -24,6 +24,6 @@ upgradeConfigs: - upgradeType: websocket typedPerFilterConfig: - envoy.filters.http.oauth2_second-route: + envoy.filters.http.oauth2/second-route: '@type': type.googleapis.com/envoy.config.route.v3.FilterConfig config: {} diff --git a/internal/xds/translator/utils.go b/internal/xds/translator/utils.go index afcc84491ce..64f946373b7 100644 --- a/internal/xds/translator/utils.go +++ b/internal/xds/translator/utils.go @@ -111,7 +111,7 @@ func enableFilterOnRoute(route *routev3.Route, filterName string) error { // perRouteFilterName generates a unique filter name for the provided filterType and configName. func perRouteFilterName(filterType, configName string) string { - return fmt.Sprintf("%s_%s", filterType, configName) + return fmt.Sprintf("%s/%s", filterType, configName) } func hcmContainsFilter(mgr *hcmv3.HttpConnectionManager, filterName string) bool {