From eec43d299e3bfdd4ebbc898cc992d872d0babd17 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 7 Feb 2023 09:10:58 +0800 Subject: [PATCH] align wellknown package (#981) Signed-off-by: hejianpeng --- internal/xds/translator/authentication.go | 3 +-- internal/xds/translator/ratelimit.go | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/xds/translator/authentication.go b/internal/xds/translator/authentication.go index 807b0c50ece..46136211371 100644 --- a/internal/xds/translator/authentication.go +++ b/internal/xds/translator/authentication.go @@ -24,7 +24,6 @@ import ( tls "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" "github.com/envoyproxy/go-control-plane/pkg/resource/v3" "github.com/envoyproxy/go-control-plane/pkg/wellknown" - wkt "github.com/envoyproxy/go-control-plane/pkg/wellknown" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" @@ -314,7 +313,7 @@ func buildJwtPerRouteConfig(irRoute *ir.HTTPRoute, listener *listener.Listener) } for _, filter := range filterCh.Filters { - if filter.Name == wkt.HTTPConnectionManager { + if filter.Name == wellknown.HTTPConnectionManager { // Unmarshal the filter to a jwt authn config and validate it. hcmProto := new(hcm.HttpConnectionManager) hcmAny := filter.GetTypedConfig() diff --git a/internal/xds/translator/ratelimit.go b/internal/xds/translator/ratelimit.go index aa4477984e8..dc6ee92557c 100644 --- a/internal/xds/translator/ratelimit.go +++ b/internal/xds/translator/ratelimit.go @@ -17,7 +17,7 @@ import ( routev3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" ratelimitfilter "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ratelimit/v3" hcm "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" - wkt "github.com/envoyproxy/go-control-plane/pkg/wellknown" + "github.com/envoyproxy/go-control-plane/pkg/wellknown" ratelimitserviceconfig "github.com/envoyproxy/ratelimit/src/config" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" @@ -37,7 +37,7 @@ func patchHCMWithRateLimit(mgr *hcm.HttpConnectionManager, irListener *ir.HTTPLi // Return early if filter already exists. for _, httpFilter := range mgr.HttpFilters { - if httpFilter.Name == wkt.HTTPRateLimit { + if httpFilter.Name == wellknown.HTTPRateLimit { return } } @@ -79,7 +79,7 @@ func buildRateLimitFilter(irListener *ir.HTTPListener) *hcm.HttpFilter { } rateLimitFilter := &hcm.HttpFilter{ - Name: wkt.HTTPRateLimit, + Name: wellknown.HTTPRateLimit, ConfigType: &hcm.HttpFilter_TypedConfig{ TypedConfig: rateLimitFilterAny, },