diff --git a/test/integration/consul-container/test/gateways/gateway_endpoint_test.go b/test/integration/consul-container/test/gateways/gateway_endpoint_test.go index 13e9cef4eea6..658e290f3d53 100644 --- a/test/integration/consul-container/test/gateways/gateway_endpoint_test.go +++ b/test/integration/consul-container/test/gateways/gateway_endpoint_test.go @@ -95,7 +95,9 @@ func TestAPIGatewayCreate(t *testing.T) { return gatewayReady && routeReady }, time.Second*10, time.Second*1) - libassert.HTTPServiceEchoes(t, "localhost", gatewayService.GetPort(listenerPortOne), "") + port, err := gatewayService.GetPort(listenerPortOne) + assert.NoError(t, err) + libassert.HTTPServiceEchoes(t, "localhost", port, "") } func isAccepted(conditions []api.Condition) bool { diff --git a/test/integration/consul-container/test/gateways/http_route_test.go b/test/integration/consul-container/test/gateways/http_route_test.go index 5300ea5b7fdf..cb2d4e063a10 100644 --- a/test/integration/consul-container/test/gateways/http_route_test.go +++ b/test/integration/consul-container/test/gateways/http_route_test.go @@ -223,7 +223,8 @@ func TestHTTPRouteFlattening(t *testing.T) { //gateway resolves routes ip := "localhost" - gatewayPort := gatewayService.GetPort(listenerPort) + gatewayPort, err := gatewayService.GetPort(listenerPort) + assert.NoError(t, err) //route 2 with headers @@ -237,23 +238,23 @@ func TestHTTPRouteFlattening(t *testing.T) { }, checkOptions{statusCode: service2ResponseCode, testName: "service2 just path match"}) ////v1 path with the header - checkRoute(t, ip, gatewayService.GetPort(listenerPort), "check", map[string]string{ + checkRoute(t, ip, gatewayPort, "check", map[string]string{ "Host": "test.foo", "x-v2": "v2", }, checkOptions{statusCode: service2ResponseCode, testName: "service2 just header match"}) - checkRoute(t, ip, gatewayService.GetPort(listenerPort), "v2/path/value", map[string]string{ + checkRoute(t, ip, gatewayPort, "v2/path/value", map[string]string{ "Host": "test.foo", "x-v2": "v2", }, checkOptions{statusCode: service2ResponseCode, testName: "service2 v2 with path"}) //hit service 1 by hitting root path - checkRoute(t, ip, gatewayService.GetPort(listenerPort), "", map[string]string{ + checkRoute(t, ip, gatewayPort, "", map[string]string{ "Host": "test.foo", }, checkOptions{debug: false, statusCode: service1ResponseCode, testName: "service1 root prefix"}) //hit service 1 by hitting v2 path with v1 hostname - checkRoute(t, ip, gatewayService.GetPort(listenerPort), "v2", map[string]string{ + checkRoute(t, ip, gatewayPort, "v2", map[string]string{ "Host": "test.example", }, checkOptions{debug: false, statusCode: service1ResponseCode, testName: "service1, v2 path with v2 hostname"})