Skip to content

Commit

Permalink
align wellknown package (#981)
Browse files Browse the repository at this point in the history
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
  • Loading branch information
zirain committed Feb 7, 2023
1 parent 3516d10 commit eec43d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/xds/translator/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions internal/xds/translator/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit eec43d2

Please sign in to comment.