Merge pull request #12529 from hashicorp/add-meta-to-service-config-response

Add `Meta` to `ServiceConfigResponse`
pull/12539/head
Eric Haberkorn 3 years ago committed by GitHub
commit abfcde1bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
```release-note:feature
server: Ensure that service-defaults `Meta` is returned with the response to the `ConfigEntry.ResolveServiceConfig` RPC.
```

@ -591,6 +591,8 @@ func (c *ConfigEntry) computeResolvedServiceConfig(
if serviceConf.Mode != structs.ProxyModeDefault {
thisReply.Mode = serviceConf.Mode
}
thisReply.Meta = serviceConf.Meta
}
// First collect all upstreams into a set of seen upstreams.

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

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

Loading…
Cancel
Save