From 3b07686648f7d941fe62050b84e98b6e46b08b98 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 11 Mar 2018 09:31:31 -0700 Subject: [PATCH] agent: remove ConnectProxyServiceName --- agent/agent_endpoint_test.go | 6 +++--- agent/structs/catalog.go | 3 --- agent/structs/testing_catalog.go | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index 05e8b6ca3d..167a233773 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -78,8 +78,8 @@ func TestAgent_Services_ConnectProxy(t *testing.T) { srv1 := &structs.NodeService{ Kind: structs.ServiceKindConnectProxy, - ID: structs.ConnectProxyServiceName, - Service: structs.ConnectProxyServiceName, + ID: "db-proxy", + Service: "db-proxy", Port: 5000, ProxyDestination: "db", } @@ -90,7 +90,7 @@ func TestAgent_Services_ConnectProxy(t *testing.T) { assert.Nil(err) val := obj.(map[string]*structs.NodeService) assert.Len(val, 1) - actual := val[structs.ConnectProxyServiceName] + actual := val["db-proxy"] assert.Equal(structs.ServiceKindConnectProxy, actual.Kind) assert.Equal("db", actual.ProxyDestination) } diff --git a/agent/structs/catalog.go b/agent/structs/catalog.go index 3f68f43a1c..b118b99352 100644 --- a/agent/structs/catalog.go +++ b/agent/structs/catalog.go @@ -18,7 +18,4 @@ const ( // Consul server node in the catalog. ConsulServiceID = "consul" ConsulServiceName = "consul" - - // ConnectProxyServiceName is the name of the proxy services. - ConnectProxyServiceName = "connect-proxy" ) diff --git a/agent/structs/testing_catalog.go b/agent/structs/testing_catalog.go index d61266ad57..1394b7081e 100644 --- a/agent/structs/testing_catalog.go +++ b/agent/structs/testing_catalog.go @@ -34,7 +34,7 @@ func TestRegisterRequestProxy(t testing.T) *RegisterRequest { func TestNodeServiceProxy(t testing.T) *NodeService { return &NodeService{ Kind: ServiceKindConnectProxy, - Service: ConnectProxyServiceName, + Service: "connect-proxy", Address: "127.0.0.2", Port: 2222, ProxyDestination: "web",