From 5eaaf791cbc00607b277d22db5fc3ac4a070fc18 Mon Sep 17 00:00:00 2001 From: Steve Sloka Date: Fri, 18 Sep 2020 15:14:58 -0400 Subject: [PATCH] internal/envoy: Update GZip to valid wellknown name Updates: #2479 Signed-off-by: Steve Sloka --- internal/envoy/listener.go | 12 +++++++----- internal/envoy/listener_test.go | 14 +++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/internal/envoy/listener.go b/internal/envoy/listener.go index 57645f92932..43bce040b55 100644 --- a/internal/envoy/listener.go +++ b/internal/envoy/listener.go @@ -40,10 +40,11 @@ import ( type HTTPVersionType = http.HttpConnectionManager_CodecType const ( - HTTPVersionAuto HTTPVersionType = http.HttpConnectionManager_AUTO - HTTPVersion1 HTTPVersionType = http.HttpConnectionManager_HTTP1 - HTTPVersion2 HTTPVersionType = http.HttpConnectionManager_HTTP2 - HTTPVersion3 HTTPVersionType = http.HttpConnectionManager_HTTP3 + HTTPVersionAuto HTTPVersionType = http.HttpConnectionManager_AUTO + HTTPVersion1 HTTPVersionType = http.HttpConnectionManager_HTTP1 + HTTPVersion2 HTTPVersionType = http.HttpConnectionManager_HTTP2 + HTTPVersion3 HTTPVersionType = http.HttpConnectionManager_HTTP3 + gzipHttpFilterName = "envoy.filters.http.compressor" ) // TLSInspector returns a new TLS inspector listener filter. @@ -204,7 +205,8 @@ func (b *httpConnectionManagerBuilder) ConnectionShutdownGracePeriod(timeout tim func (b *httpConnectionManagerBuilder) DefaultFilters() *httpConnectionManagerBuilder { b.filters = append(b.filters, &http.HttpFilter{ - Name: wellknown.Gzip, + // TODO(#2479) Update once go-control-plane constant is merged (https://github.com/envoyproxy/go-control-plane/pull/354). + Name: gzipHttpFilterName, }, &http.HttpFilter{ Name: wellknown.GRPCWeb, diff --git a/internal/envoy/listener_test.go b/internal/envoy/listener_test.go index 4e010364369..242a82ca4b5 100644 --- a/internal/envoy/listener_test.go +++ b/internal/envoy/listener_test.go @@ -338,7 +338,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -388,7 +388,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -439,7 +439,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -491,7 +491,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -542,7 +542,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -594,7 +594,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, { @@ -644,7 +644,7 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*http.HttpFilter{{ - Name: wellknown.Gzip, + Name: gzipHttpFilterName, }, { Name: wellknown.GRPCWeb, }, {