Add `Meta` to `ServiceConfigResponse`
This commit is contained in:
parent
19fe3e14d1
commit
3d46f9ef7c
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:feature
|
||||||
|
server: Ensure that service-defaults `Meta` to is included in `ServiceConfigResponse`.
|
||||||
|
```
|
|
@ -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.
|
||||||
|
|
|
@ -1029,10 +1029,12 @@ 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,
|
||||||
}))
|
}))
|
||||||
require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{
|
require.NoError(t, state.EnsureConfigEntry(2, &structs.ServiceConfigEntry{
|
||||||
Kind: structs.ServiceDefaults,
|
Kind: structs.ServiceDefaults,
|
||||||
|
@ -1058,6 +1060,7 @@ func TestConfigEntry_ResolveServiceConfig(t *testing.T) {
|
||||||
"protocol": "grpc",
|
"protocol": "grpc",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Meta: meta,
|
||||||
// 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
|
||||||
QueryMeta
|
QueryMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue