From 45312886fed1707041b745f64e3621c046a885b7 Mon Sep 17 00:00:00 2001 From: Eric Haberkorn Date: Mon, 7 Mar 2022 14:35:33 -0500 Subject: [PATCH] Code review changes --- .changelog/12529.txt | 2 +- agent/consul/config_endpoint_test.go | 5 ++--- agent/structs/config_entry.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.changelog/12529.txt b/.changelog/12529.txt index 15368df15..c4ebe87e5 100644 --- a/.changelog/12529.txt +++ b/.changelog/12529.txt @@ -1,3 +1,3 @@ ```release-note:feature -server: Ensure that service-defaults `Meta` to is included in `ServiceConfigResponse`. +server: Ensure that service-defaults `Meta` is returned with the response to the `ConfigEntry.ResolveServiceConfig` RPC. ``` diff --git a/agent/consul/config_endpoint_test.go b/agent/consul/config_endpoint_test.go index f9e1e310d..e5c0b7f6d 100644 --- a/agent/consul/config_endpoint_test.go +++ b/agent/consul/config_endpoint_test.go @@ -1029,12 +1029,11 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) { "foo": 1, }, })) - meta := map[string]string{"foo": "bar"} require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{ Kind: structs.ServiceDefaults, Name: "foo", Protocol: "http", - Meta: meta, + Meta: map[string]string{"foo": "bar"}, })) require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{ Kind: structs.ServiceDefaults, @@ -1060,7 +1059,7 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) { "protocol": "grpc", }, }, - Meta: meta, + Meta: map[string]string{"foo": "bar"}, // Don't know what this is deterministically QueryMeta: out.QueryMeta, } diff --git a/agent/structs/config_entry.go b/agent/structs/config_entry.go index f7b82d80f..4ca0ee631 100644 --- a/agent/structs/config_entry.go +++ b/agent/structs/config_entry.go @@ -985,7 +985,7 @@ type ServiceConfigResponse struct { Expose ExposeConfig `json:",omitempty"` TransparentProxy TransparentProxyConfig `json:",omitempty"` Mode ProxyMode `json:",omitempty"` - Meta map[string]string + Meta map[string]string `json:",omitempty"` QueryMeta }