Repository: knative-sandbox/net-kourier
Pull request #341 (2020-11-06 09:46:31)

Use external connection manager for SNI based listener too
This seems to just work but I don't have enough knowledge of the innerts of the envoy to know if this would break anything.

My understanding is that the filter chain applies to the SNIHosts only anyway and that the manager is just managing the connections to the upstreams. I'd think it shouldn't hurt if that manager references every host, in theory, but maybe I'm wrong and this generates a ton of overhead :thinking:.

/assign @jmprusi @davidor 

knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/net-kourier/pull/341#" title="Author self-approved">markusthoemmes</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Fnet-kourier).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/knative-sandbox/net-kourier/blob/master/OWNERS)~~ [markusthoemmes]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
knative-prow-robot: @markusthoemmes: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-unit-tests | def1468221d3f286830de023bbd58e081b99c51d | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-unit-tests/1324649373748957184) | `/test pull-knative-sandbox-net-kourier-unit-tests`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-net-kourier-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/envoy/api/http_connection_manager.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324649373795094528/artifacts/line-cov.html#file0) | 92.6% | 80.0% | -12.6
[pkg/envoy/api/listener.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324649373795094528/artifacts/line-cov.html#file1) | 77.8% | 77.1% | -0.6
[pkg/generator/generator.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324649373795094528/artifacts/line-cov.html#file2) | 34.8% | 37.2% | 2.4

knative-prow-robot: @markusthoemmes: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-unit-tests | def1468221d3f286830de023bbd58e081b99c51d | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-unit-tests/1324649373748957184) | `/test pull-knative-sandbox-net-kourier-unit-tests`
pull-knative-sandbox-net-kourier-go-coverage | def1468221d3f286830de023bbd58e081b99c51d | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324649373795094528) | `/test pull-knative-sandbox-net-kourier-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-net-kourier-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/envoy/api/http_connection_manager.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324653770000306176/artifacts/line-cov.html#file0) | 92.6% | 80.0% | -12.6
[pkg/envoy/api/listener.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324653770000306176/artifacts/line-cov.html#file1) | 77.8% | 77.1% | -0.6
[pkg/generator/generator.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324653770000306176/artifacts/line-cov.html#file2) | 34.8% | 37.2% | 2.4

knative-prow-robot: @markusthoemmes: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-go-coverage | f53a0d44f86318f95b5e8657e90765ca2f0cfe41 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324653770000306176) | `/test pull-knative-sandbox-net-kourier-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=h1) Report
> Merging [#341](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=desc) into [master](https://codecov.io/gh/knative-sandbox/net-kourier/commit/eeb77038cfe6baafb8ab6b559a8e97078afb1fba?el=desc) will **decrease** coverage by `0.47%`.
> The diff coverage is `50.00%`.

[![Impacted file tree graph](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341/graphs/tree.svg?width=650&height=150&src=pr&token=KmlRo23zX4)](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
- Coverage   67.85%   67.37%   -0.48%     
==========================================
  Files          13       13              
  Lines         535      515      -20     
==========================================
- Hits          363      347      -16     
+ Misses        143      139       -4     
  Partials       29       29              
```


| [Impacted Files](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pkg/envoy/api/http\_connection\_manager.go](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341/diff?src=pr&el=tree#diff-cGtnL2Vudm95L2FwaS9odHRwX2Nvbm5lY3Rpb25fbWFuYWdlci5nbw==) | `58.33% <ø> (-12.26%)` | :arrow_down: |
| [pkg/generator/generator.go](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341/diff?src=pr&el=tree#diff-cGtnL2dlbmVyYXRvci9nZW5lcmF0b3IuZ28=) | `27.08% <0.00%> (+2.08%)` | :arrow_up: |
| [pkg/envoy/api/listener.go](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341/diff?src=pr&el=tree#diff-cGtnL2Vudm95L2FwaS9saXN0ZW5lci5nbw==) | `80.00% <100.00%> (-0.22%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=footer). Last update [eeb7703...9501c04](https://codecov.io/gh/knative-sandbox/net-kourier/pull/341?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-net-kourier-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/envoy/api/http_connection_manager.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324654344540262400/artifacts/line-cov.html#file0) | 92.6% | 70.0% | -22.6
[pkg/envoy/api/listener.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324654344540262400/artifacts/line-cov.html#file1) | 77.8% | 77.1% | -0.6
[pkg/generator/generator.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324654344540262400/artifacts/line-cov.html#file2) | 34.8% | 37.2% | 2.4

knative-prow-robot: @markusthoemmes: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-go-coverage | 9501c04e5f95fce6fcc22a76b635e69888d3ef45 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324654344540262400) | `/test pull-knative-sandbox-net-kourier-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-net-kourier-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/envoy/api/http_connection_manager.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324655125007962112/artifacts/line-cov.html#file0) | 92.6% | 70.0% | -22.6
[pkg/envoy/api/listener.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324655125007962112/artifacts/line-cov.html#file1) | 77.8% | 77.1% | -0.6
[pkg/generator/generator.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324655125007962112/artifacts/line-cov.html#file2) | 34.8% | 37.2% | 2.4

knative-prow-robot: @markusthoemmes: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-go-coverage | 8aa938e8157c5b491ac02bb4f78091a9eff98eaa | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324655125007962112) | `/test pull-knative-sandbox-net-kourier-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-net-kourier-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/envoy/api/http_connection_manager.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324656425686798336/artifacts/line-cov.html#file0) | 92.6% | 77.8% | -14.8
[pkg/envoy/api/listener.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324656425686798336/artifacts/line-cov.html#file1) | 77.8% | 77.1% | -0.6
[pkg/generator/generator.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324656425686798336/artifacts/line-cov.html#file2) | 34.8% | 34.1% | -0.6

knative-prow-robot: @markusthoemmes: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-net-kourier-go-coverage | 890a2b6b1eab21dcd8914bd9ba5ab6cd65303cb5 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_net-kourier/341/pull-knative-sandbox-net-kourier-go-coverage/1324656425686798336) | `/test pull-knative-sandbox-net-kourier-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_net-kourier/341). [Your PR dashboard](https://gubernator.knative.dev/pr/markusthoemmes).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jmprusi: /lgtm

Patch:
diff --git a/pkg/envoy/api/http_connection_manager.go b/pkg/envoy/api/http_connection_manager.go
index ac144a93..e72dd754 100644
--- a/pkg/envoy/api/http_connection_manager.go
+++ b/pkg/envoy/api/http_connection_manager.go
@@ -29,7 +29,7 @@ import (
 	"knative.dev/net-kourier/pkg/config"
 )
 
-func NewHTTPConnectionManager() *httpconnectionmanagerv2.HttpConnectionManager {
+func NewHTTPConnectionManager(routeConfigName string) *httpconnectionmanagerv2.HttpConnectionManager {
 	var filters []*httpconnectionmanagerv2.HttpFilter
 
 	if config.ExternalAuthz.Enabled {
@@ -47,6 +47,20 @@ func NewHTTPConnectionManager() *httpconnectionmanagerv2.HttpConnectionManager {
 		StatPrefix:  "ingress_http",
 		HttpFilters: filters,
 		AccessLog:   accessLogs(),
+		RouteSpecifier: &httpconnectionmanagerv2.HttpConnectionManager_Rds{
+			Rds: &httpconnectionmanagerv2.Rds{
+				ConfigSource: &envoy_api_v2_core.ConfigSource{
+					ConfigSourceSpecifier: &envoy_api_v2_core.ConfigSource_Ads{
+						Ads: &envoy_api_v2_core.AggregatedConfigSource{},
+					},
+					InitialFetchTimeout: &duration.Duration{
+						Seconds: 10,
+						Nanos:   0,
+					},
+				},
+				RouteConfigName: routeConfigName,
+			},
+		},
 	}
 }
 
@@ -57,23 +71,6 @@ func NewRouteConfig(name string, virtualHosts []*route.VirtualHost) *v2.RouteCon
 	}
 }
 
-func NewRDSHTTPConnectionManager(routeConfigName string) *httpconnectionmanagerv2.HttpConnectionManager_Rds {
-	return &httpconnectionmanagerv2.HttpConnectionManager_Rds{
-		Rds: &httpconnectionmanagerv2.Rds{
-			ConfigSource: &envoy_api_v2_core.ConfigSource{
-				ConfigSourceSpecifier: &envoy_api_v2_core.ConfigSource_Ads{
-					Ads: &envoy_api_v2_core.AggregatedConfigSource{},
-				},
-				InitialFetchTimeout: &duration.Duration{
-					Seconds: 10,
-					Nanos:   0,
-				},
-			},
-			RouteConfigName: routeConfigName,
-		},
-	}
-}
-
 // Outputs to /dev/stdout using the default format
 func accessLogs() []*envoy_accesslog_v2.AccessLog {
 	accessLog, _ := ptypes.MarshalAny(&accesslog_v2.FileAccessLog{
@@ -87,46 +84,3 @@ func accessLogs() []*envoy_accesslog_v2.AccessLog {
 		},
 	}}
 }
-
-// Returns a copy of the HttpConnectionManager received in the params changing
-// only the virtual hosts in the route config. It filters the virtual hosts
-// keeping only the ones whose domains contain all the domains received in the
-// params.
-func filterByDomains(connManager *httpconnectionmanagerv2.HttpConnectionManager, domains []string) *httpconnectionmanagerv2.HttpConnectionManager {
-	rc := connManager.GetRouteSpecifier().(*httpconnectionmanagerv2.HttpConnectionManager_RouteConfig).RouteConfig
-
-	res := NewHTTPConnectionManager()
-
-	var newVirtualHosts []*route.VirtualHost
-	for _, virtualHost := range rc.GetVirtualHosts() {
-		if containsAll(virtualHost.Domains, domains) {
-			newVirtualHosts = append(newVirtualHosts, virtualHost)
-		}
-	}
-
-	res.RouteSpecifier = &httpconnectionmanagerv2.HttpConnectionManager_RouteConfig{
-		RouteConfig: NewRouteConfig(rc.Name, newVirtualHosts),
-	}
-
-	return res
-}
-
-// Returns true if slice contains all the items in elems
-func containsAll(slice []string, elems []string) bool {
-	for _, elem := range elems {
-		contained := false
-
-		for _, s := range slice {
-			if elem == s {
-				contained = true
-				break
-			}
-		}
-
-		if !contained {
-			return false
-		}
-	}
-
-	return true
-}
diff --git a/pkg/envoy/api/listener.go b/pkg/envoy/api/listener.go
index 684c1293..7136b1cc 100644
--- a/pkg/envoy/api/listener.go
+++ b/pkg/envoy/api/listener.go
@@ -136,11 +136,7 @@ func createFilters(manager *httpconnmanagerv2.HttpConnectionManager) ([]*listene
 func createFilterChainsForTLS(manager *httpconnmanagerv2.HttpConnectionManager, sniMatches []*SNIMatch) ([]*listener.FilterChain, error) {
 	res := make([]*listener.FilterChain, 0, len(sniMatches))
 	for _, sniMatch := range sniMatches {
-		// The connection manager received in the params contains all the
-		// matching rules. For each sniMatch, we just need the rules defined for
-		// the same hosts defined in the sniMatch
-		connManager := filterByDomains(manager, sniMatch.hosts)
-		filters, err := createFilters(connManager)
+		filters, err := createFilters(manager)
 		if err != nil {
 			return nil, err
 		}
diff --git a/pkg/generator/generator.go b/pkg/generator/generator.go
index af8b4051..625f435e 100644
--- a/pkg/generator/generator.go
+++ b/pkg/generator/generator.go
@@ -77,10 +77,8 @@ func listenersFromVirtualHosts(
 	caches.routeConfig = []*v2.RouteConfiguration{externalRouteConfig, internalRouteConfig}
 
 	// Now we setup connection managers, that reference the routeconfigs via RDS.
-	externalManager := envoy.NewHTTPConnectionManager()
-	internalManager := envoy.NewHTTPConnectionManager()
-	externalManager.RouteSpecifier = envoy.NewRDSHTTPConnectionManager(externalRouteConfig.Name)
-	internalManager.RouteSpecifier = envoy.NewRDSHTTPConnectionManager(internalRouteConfig.Name)
+	externalManager := envoy.NewHTTPConnectionManager(externalRouteConfig.Name)
+	internalManager := envoy.NewHTTPConnectionManager(internalRouteConfig.Name)
 	externalHTTPEnvoyListener, err := envoy.NewHTTPListener(externalManager, config.HTTPPortExternal)
 	if err != nil {
 		return nil, err
@@ -96,12 +94,7 @@ func listenersFromVirtualHosts(
 	// TLS field, that takes precedence. If there is not, TLS will be configured
 	// using a single cert for all the services if the creds are given via ENV.
 	if len(sniMatches) > 0 {
-		// TODO: Can we make this work with "HttpConnectionManager_Rds"?
-		sniManager := envoy.NewHTTPConnectionManager()
-		sniManager.RouteSpecifier = &httpconnmanagerv2.HttpConnectionManager_RouteConfig{
-			RouteConfig: externalRouteConfig,
-		}
-		externalHTTPSEnvoyListener, err := newExternalHTTPSEnvoyListener(sniManager, sniMatches)
+		externalHTTPSEnvoyListener, err := envoy.NewHTTPSListenerWithSNI(externalManager, config.HTTPSPortExternal, sniMatches)
 		if err != nil {
 			return nil, err
 		}
@@ -145,7 +138,3 @@ func newExternalEnvoyListenerWithOneCert(ctx context.Context, manager *httpconnm
 
 	return envoy.NewHTTPSListener(manager, config.HTTPSPortExternal, certificateChain, privateKey)
 }
-
-func newExternalHTTPSEnvoyListener(manager *httpconnmanagerv2.HttpConnectionManager, sniMatches []*envoy.SNIMatch) (*v2.Listener, error) {
-	return envoy.NewHTTPSListenerWithSNI(manager, config.HTTPSPortExternal, sniMatches)
-}


Test patch:
diff --git a/pkg/envoy/api/http_connection_manager_test.go b/pkg/envoy/api/http_connection_manager_test.go
index 407e7a23..f01a0f2e 100644
--- a/pkg/envoy/api/http_connection_manager_test.go
+++ b/pkg/envoy/api/http_connection_manager_test.go
@@ -26,7 +26,7 @@ import (
 )
 
 func TestCreatesManagerThatOutputsToStdOut(t *testing.T) {
-	connManager := NewHTTPConnectionManager()
+	connManager := NewHTTPConnectionManager("test")
 	accessLog := connManager.AccessLog[0]
 	accessLogPathAny := accessLog.ConfigType.(*envoy_config_filter_accesslog_v2.AccessLog_TypedConfig).TypedConfig
 	fileAccesLog := &accesslog_v2.FileAccessLog{}
diff --git a/pkg/envoy/api/listener_test.go b/pkg/envoy/api/listener_test.go
index 79cba6e6..a6f04e67 100644
--- a/pkg/envoy/api/listener_test.go
+++ b/pkg/envoy/api/listener_test.go
@@ -25,8 +25,6 @@ import (
 	auth "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"
 	core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
 	envoy_api_v2_listener "github.com/envoyproxy/go-control-plane/envoy/api/v2/listener"
-	route "github.com/envoyproxy/go-control-plane/envoy/api/v2/route"
-	httpconnmanagerv2 "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2"
 	"github.com/envoyproxy/go-control-plane/pkg/wellknown"
 	"github.com/golang/protobuf/ptypes"
 	"gotest.tools/assert"
@@ -34,7 +32,7 @@ import (
 )
 
 func TestNewHTTPListener(t *testing.T) {
-	manager := NewHTTPConnectionManager()
+	manager := NewHTTPConnectionManager("test")
 
 	l, err := NewHTTPListener(manager, 8080)
 	if err != nil {
@@ -48,7 +46,7 @@ func TestNewHTTPListener(t *testing.T) {
 }
 
 func TestNewHTTPSListener(t *testing.T) {
-	manager := NewHTTPConnectionManager()
+	manager := NewHTTPConnectionManager("test")
 
 	certChain := []byte("some_certificate_chain")
 	privateKey := []byte("some_private_key")
@@ -80,18 +78,7 @@ func TestNewHTTPSListenerWithSNI(t *testing.T) {
 		privateKey:       []byte("key2"),
 	}}
 
-	vHost1 := NewVirtualHost(
-		"vHost1", []string{"some_host.com", "some_host.com:*"}, []*route.Route{},
-	)
-	vHost2 := NewVirtualHost(
-		"vHost2", []string{"another_host.com", "another_host.com:*"}, []*route.Route{},
-	)
-
-	manager := NewHTTPConnectionManager()
-	manager.RouteSpecifier = &httpconnmanagerv2.HttpConnectionManager_RouteConfig{
-		RouteConfig: NewRouteConfig("test", []*route.VirtualHost{vHost1, vHost2}),
-	}
-
+	manager := NewHTTPConnectionManager("test")
 	listener, err := NewHTTPSListenerWithSNI(manager, 8443, sniMatches)
 	if err != nil {
 		t.Error(err)
@@ -104,16 +91,11 @@ func TestNewHTTPSListenerWithSNI(t *testing.T) {
 	// Listener Filter required for SNI
 	assert.Equal(t, listener.ListenerFilters[0].Name, wellknown.TlsInspector)
 
-	assertListenerHasSNIMatchConfigured(
-		t, listener, sniMatches[0], []string{"some_host.com", "some_host.com:*"},
-	)
-
-	assertListenerHasSNIMatchConfigured(
-		t, listener, sniMatches[1], []string{"another_host.com", "another_host.com:*"},
-	)
+	assertListenerHasSNIMatchConfigured(t, listener, sniMatches[0])
+	assertListenerHasSNIMatchConfigured(t, listener, sniMatches[1])
 }
 
-func assertListenerHasSNIMatchConfigured(t *testing.T, listener *envoy_api_v2.Listener, match *SNIMatch, expectedVHostDomains []string) {
+func assertListenerHasSNIMatchConfigured(t *testing.T, listener *envoy_api_v2.Listener, match *SNIMatch) {
 	filterChainFirstSNIMatch := getFilterChainByServerName(listener, match.hosts)
 	assert.Assert(t, filterChainFirstSNIMatch != nil)
 
@@ -121,10 +103,6 @@ func assertListenerHasSNIMatchConfigured(t *testing.T, listener *envoy_api_v2.Li
 	assert.NilError(t, err)
 	assert.DeepEqual(t, match.certificateChain, certChain)
 	assert.DeepEqual(t, match.privateKey, privateKey)
-
-	vHostsDomains, err := getVHostDomains(filterChainFirstSNIMatch)
-	assert.NilError(t, err)
-	assert.DeepEqual(t, expectedVHostDomains, vHostsDomains)
 }
 
 func getFilterChainByServerName(listener *envoy_api_v2.Listener, serverNames []string) *envoy_api_v2_listener.FilterChain {
@@ -159,21 +137,3 @@ func getTLSCreds(filterChain *envoy_api_v2_listener.FilterChain) (certChain []by
 
 	return certChain, privateKey, nil
 }
-
-// Note: Returns an error when there are multiple virtual hosts configured
-func getVHostDomains(filterChain *envoy_api_v2_listener.FilterChain) ([]string, error) {
-	connManager := httpconnmanagerv2.HttpConnectionManager{}
-	err := ptypes.UnmarshalAny(filterChain.Filters[0].GetTypedConfig(), &connManager)
-
-	if err != nil {
-		return nil, err
-	}
-
-	routeConfig := connManager.GetRouteSpecifier().(*httpconnmanagerv2.HttpConnectionManager_RouteConfig).RouteConfig
-
-	if len(routeConfig.VirtualHosts) > 1 {
-		return nil, fmt.Errorf("more than one virtual host configured")
-	}
-
-	return routeConfig.VirtualHosts[0].Domains, nil
-}