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
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,
},
}))
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,
}

View File

@ -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
}