mirror of
https://github.com/status-im/consul.git
synced 2025-01-29 15:05:04 +00:00
Merge pull request #12529 from hashicorp/add-meta-to-service-config-response
Add `Meta` to `ServiceConfigResponse`
This commit is contained in:
commit
abfcde1bc6
3
.changelog/12529.txt
Normal file
3
.changelog/12529.txt
Normal file
@ -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 {
|
if serviceConf.Mode != structs.ProxyModeDefault {
|
||||||
thisReply.Mode = serviceConf.Mode
|
thisReply.Mode = serviceConf.Mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thisReply.Meta = serviceConf.Meta
|
||||||
}
|
}
|
||||||
|
|
||||||
// First collect all upstreams into a set of seen upstreams.
|
// First collect all upstreams into a set of seen upstreams.
|
||||||
|
@ -1033,6 +1033,7 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) {
|
|||||||
Kind: structs.ServiceDefaults,
|
Kind: structs.ServiceDefaults,
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Protocol: "http",
|
Protocol: "http",
|
||||||
|
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,
|
||||||
@ -1058,6 +1059,7 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) {
|
|||||||
"protocol": "grpc",
|
"protocol": "grpc",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
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,
|
||||||
}
|
}
|
||||||
|
@ -985,6 +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 `json:",omitempty"`
|
||||||
QueryMeta
|
QueryMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user