From 681bd8f57b1191a93e7cb595876386a412d28f1a Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 19 Feb 2020 12:54:34 -0800 Subject: [PATCH 1/2] agent: remove unused makeTelemetryDefaults() --- agent/agent_endpoint_test.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index 8dd0145504..02fea80ad6 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -36,7 +36,6 @@ import ( tokenStore "github.com/hashicorp/consul/agent/token" "github.com/hashicorp/consul/agent/xds/proxysupport" "github.com/hashicorp/consul/api" - "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/testrpc" @@ -6138,13 +6137,6 @@ func requireLeafValidUnderCA(t *testing.T, issued *structs.IssuedCert, ca *struc require.NoError(t, err) } -func makeTelemetryDefaults(targetID string) lib.TelemetryConfig { - return lib.TelemetryConfig{ - FilterDefault: true, - MetricsPrefix: "consul.proxy." + targetID, - } -} - func TestAgentConnectAuthorize_badBody(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") From 4bad87c293548fe389059c41bf6ab694e8515e08 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 19 Feb 2020 13:04:23 -0800 Subject: [PATCH 2/2] agent: use testAgent_RegisterService_TranslateKeys() When this test was refactored it looks like there was a copy+paste error and the test case was made to call the wrong function. --- agent/agent_endpoint_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index 02fea80ad6..5e3784726b 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -3156,11 +3156,11 @@ func TestAgent_RegisterService_TranslateKeys(t *testing.T) { t.Run("normal", func(t *testing.T) { t.Parallel() - testAgent_RegisterService_ACLDeny(t, "enable_central_service_config = false") + testAgent_RegisterService_TranslateKeys(t, "enable_central_service_config = false") }) t.Run("service manager", func(t *testing.T) { t.Parallel() - testAgent_RegisterService_ACLDeny(t, "enable_central_service_config = true") + testAgent_RegisterService_TranslateKeys(t, "enable_central_service_config = true") }) } @@ -3329,6 +3329,7 @@ func testAgent_RegisterService_TranslateKeys(t *testing.T, extraHCL string) { "some": "meta", "enable_tag_override": "sidecar_service.meta is 'opaque' so should not get translated", }, + TaggedAddresses: map[string]structs.ServiceAddress{}, Port: 8001, EnableTagOverride: true, Weights: &structs.Weights{Passing: 1, Warning: 1},