diff --git a/dependency/catalog_node_test.go b/dependency/catalog_node_test.go index bad007a21..be9862df0 100644 --- a/dependency/catalog_node_test.go +++ b/dependency/catalog_node_test.go @@ -99,7 +99,6 @@ func TestCatalogNodeQuery_Fetch(t *testing.T) { }, Meta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, }, Services: []*CatalogNodeService{ @@ -157,6 +156,7 @@ func TestCatalogNodeQuery_Fetch(t *testing.T) { if n := act.(*CatalogNode).Node; n != nil { n.ID = "" n.TaggedAddresses = filterAddresses(n.TaggedAddresses) + n.Meta = filterVersionMeta(n.Meta) } // delete any version data from ServiceMeta services := act.(*CatalogNode).Services diff --git a/dependency/catalog_nodes_test.go b/dependency/catalog_nodes_test.go index 71c0c51e3..6a18f4988 100644 --- a/dependency/catalog_nodes_test.go +++ b/dependency/catalog_nodes_test.go @@ -92,7 +92,6 @@ func TestCatalogNodesQuery_Fetch(t *testing.T) { }, Meta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, }, }, @@ -115,6 +114,7 @@ func TestCatalogNodesQuery_Fetch(t *testing.T) { for _, n := range act.([]*Node) { n.ID = "" n.TaggedAddresses = filterAddresses(n.TaggedAddresses) + n.Meta = filterVersionMeta(n.Meta) } } diff --git a/dependency/catalog_service_test.go b/dependency/catalog_service_test.go index 9e4ed121e..85c07a744 100644 --- a/dependency/catalog_service_test.go +++ b/dependency/catalog_service_test.go @@ -164,7 +164,6 @@ func TestCatalogServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceID: "consul", ServiceName: "consul", @@ -189,7 +188,6 @@ func TestCatalogServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceID: "service-meta", ServiceName: "service-meta", @@ -225,6 +223,8 @@ func TestCatalogServiceQuery_Fetch(t *testing.T) { for i := range act_list { act_list[i].ServiceMeta = filterVersionMeta( act_list[i].ServiceMeta) + act_list[i].NodeMeta = filterVersionMeta( + act_list[i].NodeMeta) } assert.Equal(t, tc.exp, act) diff --git a/dependency/consul_common_test.go b/dependency/consul_common_test.go index b8095fed8..06527d3df 100644 --- a/dependency/consul_common_test.go +++ b/dependency/consul_common_test.go @@ -21,7 +21,7 @@ func filterVersionMeta(meta map[string]string) map[string]string { filteredMeta := []string{ "raft_version", "serf_protocol_current", "serf_protocol_min", "serf_protocol_max", "version", - "non_voter", "read_replica", "grpc_port", "grpc_tls_port", + "non_voter", "read_replica", "grpc_port", "grpc_tls_port", "consul-version", } return filter(meta, filteredMeta) } diff --git a/dependency/health_service_test.go b/dependency/health_service_test.go index 58e9f8aba..5dffe2aad 100644 --- a/dependency/health_service_test.go +++ b/dependency/health_service_test.go @@ -272,7 +272,6 @@ func TestHealthConnectServiceQuery_Fetch(t *testing.T) { Tags: ServiceTags([]string{}), NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, Weights: api.AgentWeights{ Passing: 1, @@ -305,6 +304,7 @@ func TestHealthConnectServiceQuery_Fetch(t *testing.T) { inst.Checks = nil inst.NodeTaggedAddresses = nil inst.ServiceTaggedAddresses = nil + inst.NodeMeta = filterVersionMeta(inst.NodeMeta) assert.Equal(t, tc.exp, act) }) @@ -330,7 +330,6 @@ func TestHealthServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceMeta: map[string]string{}, Address: testConsul.Config.Bind, @@ -364,7 +363,6 @@ func TestHealthServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceMeta: map[string]string{}, Address: testConsul.Config.Bind, @@ -393,7 +391,6 @@ func TestHealthServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceMeta: map[string]string{ "meta1": "value1", @@ -423,7 +420,6 @@ func TestHealthServiceQuery_Fetch(t *testing.T) { }, NodeMeta: map[string]string{ "consul-network-segment": "", - "consul-version": "1.17.0", }, ServiceMeta: map[string]string{}, Address: testConsul.Config.Bind, @@ -470,6 +466,8 @@ func TestHealthServiceQuery_Fetch(t *testing.T) { v.ServiceMeta = filterVersionMeta(v.ServiceMeta) v.NodeTaggedAddresses = filterAddresses( v.NodeTaggedAddresses) + v.NodeMeta = filterVersionMeta(v.NodeMeta) + } }