Code review changes

This commit is contained in:
Eric Haberkorn 2022-03-07 14:35:33 -05:00 committed by Eric
parent f7cc7ff5cd
commit 9d0ec2eec2
3 changed files with 4 additions and 5 deletions

View File

@ -1,3 +1,3 @@
```release-note:feature ```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.
``` ```

View File

@ -1029,12 +1029,11 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) {
"foo": 1, "foo": 1,
}, },
})) }))
meta := map[string]string{"foo": "bar"}
require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{ require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{
Kind: structs.ServiceDefaults, Kind: structs.ServiceDefaults,
Name: "foo", Name: "foo",
Protocol: "http", Protocol: "http",
Meta: meta, Meta: map[string]string{"foo": "bar"},
})) }))
require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{ require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{
Kind: structs.ServiceDefaults, Kind: structs.ServiceDefaults,
@ -1060,7 +1059,7 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) {
"protocol": "grpc", "protocol": "grpc",
}, },
}, },
Meta: meta, Meta: map[string]string{"foo": "bar"},
// Don't know what this is deterministically // Don't know what this is deterministically
QueryMeta: out.QueryMeta, QueryMeta: out.QueryMeta,
} }

View File

@ -985,7 +985,7 @@ type ServiceConfigResponse struct {
Expose ExposeConfig `json:",omitempty"` Expose ExposeConfig `json:",omitempty"`
TransparentProxy TransparentProxyConfig `json:",omitempty"` TransparentProxy TransparentProxyConfig `json:",omitempty"`
Mode ProxyMode `json:",omitempty"` Mode ProxyMode `json:",omitempty"`
Meta map[string]string Meta map[string]string `json:",omitempty"`
QueryMeta QueryMeta
} }