From 318aa094fd8e635ca65f8795276a6edf3829a326 Mon Sep 17 00:00:00 2001 From: freddygv Date: Thu, 3 Sep 2020 10:21:20 -0600 Subject: [PATCH] Fix http assertion in route creation --- agent/xds/routes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/xds/routes.go b/agent/xds/routes.go index c95e748551..0f73e2bb47 100644 --- a/agent/xds/routes.go +++ b/agent/xds/routes.go @@ -50,7 +50,10 @@ func routesFromSnapshotTerminatingGateway(_ connectionInfo, cfgSnap *proxycfg.Co svcConfig := cfgSnap.TerminatingGateway.ServiceConfigs[svc] cfg, err := ParseProxyConfig(svcConfig.ProxyConfig) - if err != nil || structs.IsProtocolHTTPLike(cfg.Protocol) { + if err != nil { + return nil, fmt.Errorf("failed to parse upstream config: %v", err) + } + if !structs.IsProtocolHTTPLike(cfg.Protocol) { // Routes can only be defined for HTTP services continue }