mirror of https://github.com/hashicorp/consul
pull over Validate_Clusters to api package in 1.15.x (#21631)
pull over Validate_Clusters to api packagepull/21645/head
parent
bca50b0b14
commit
4c52555b99
|
@ -16,6 +16,14 @@ type MeshConfigEntry struct {
|
||||||
// when enabled.
|
// when enabled.
|
||||||
TransparentProxy TransparentProxyMeshConfig `alias:"transparent_proxy"`
|
TransparentProxy TransparentProxyMeshConfig `alias:"transparent_proxy"`
|
||||||
|
|
||||||
|
// ValidateClusters controls whether the clusters the route table refers to are validated. The default value is
|
||||||
|
// false. When set to false and a route refers to a cluster that does not exist, the route table loads and routing
|
||||||
|
// to a non-existent cluster results in a 404. When set to true and the route is set to a cluster that do not exist,
|
||||||
|
// the route table will not load. For more information, refer to
|
||||||
|
// [HTTP route configuration in the Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto#envoy-v3-api-field-config-route-v3-routeconfiguration-validate-clusters)
|
||||||
|
// for more details.
|
||||||
|
ValidateClusters bool `json:",omitempty" alias:"validate_clusters"`
|
||||||
|
|
||||||
TLS *MeshTLSConfig `json:",omitempty"`
|
TLS *MeshTLSConfig `json:",omitempty"`
|
||||||
|
|
||||||
HTTP *MeshHTTPConfig `json:",omitempty"`
|
HTTP *MeshHTTPConfig `json:",omitempty"`
|
||||||
|
|
|
@ -22,6 +22,14 @@ type MeshConfigEntry struct {
|
||||||
// in transparent mode.
|
// in transparent mode.
|
||||||
TransparentProxy TransparentProxyMeshConfig `alias:"transparent_proxy"`
|
TransparentProxy TransparentProxyMeshConfig `alias:"transparent_proxy"`
|
||||||
|
|
||||||
|
// ValidateClusters controls whether the clusters the route table refers to are validated. The default value is
|
||||||
|
// false. When set to false and a route refers to a cluster that does not exist, the route table loads and routing
|
||||||
|
// to a non-existent cluster results in a 404. When set to true and the route is set to a cluster that do not exist,
|
||||||
|
// the route table will not load. For more information, refer to
|
||||||
|
// [HTTP route configuration in the Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto#envoy-v3-api-field-config-route-v3-routeconfiguration-validate-clusters)
|
||||||
|
// for more details.
|
||||||
|
ValidateClusters bool `json:",omitempty" alias:"validate_clusters"`
|
||||||
|
|
||||||
TLS *MeshTLSConfig `json:",omitempty"`
|
TLS *MeshTLSConfig `json:",omitempty"`
|
||||||
|
|
||||||
HTTP *MeshHTTPConfig `json:",omitempty"`
|
HTTP *MeshHTTPConfig `json:",omitempty"`
|
||||||
|
|
|
@ -1047,6 +1047,7 @@ func MeshConfigToStructs(s *MeshConfig, t *structs.MeshConfigEntry) {
|
||||||
if s.TransparentProxy != nil {
|
if s.TransparentProxy != nil {
|
||||||
TransparentProxyMeshConfigToStructs(s.TransparentProxy, &t.TransparentProxy)
|
TransparentProxyMeshConfigToStructs(s.TransparentProxy, &t.TransparentProxy)
|
||||||
}
|
}
|
||||||
|
t.ValidateClusters = s.ValidateClusters
|
||||||
if s.TLS != nil {
|
if s.TLS != nil {
|
||||||
var x structs.MeshTLSConfig
|
var x structs.MeshTLSConfig
|
||||||
MeshTLSConfigToStructs(s.TLS, &x)
|
MeshTLSConfigToStructs(s.TLS, &x)
|
||||||
|
@ -1074,6 +1075,7 @@ func MeshConfigFromStructs(t *structs.MeshConfigEntry, s *MeshConfig) {
|
||||||
TransparentProxyMeshConfigFromStructs(&t.TransparentProxy, &x)
|
TransparentProxyMeshConfigFromStructs(&t.TransparentProxy, &x)
|
||||||
s.TransparentProxy = &x
|
s.TransparentProxy = &x
|
||||||
}
|
}
|
||||||
|
s.ValidateClusters = t.ValidateClusters
|
||||||
if t.TLS != nil {
|
if t.TLS != nil {
|
||||||
var x MeshTLSConfig
|
var x MeshTLSConfig
|
||||||
MeshTLSConfigFromStructs(t.TLS, &x)
|
MeshTLSConfigFromStructs(t.TLS, &x)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -57,6 +57,7 @@ message MeshConfig {
|
||||||
map<string, string> Meta = 4;
|
map<string, string> Meta = 4;
|
||||||
PeeringMeshConfig Peering = 5;
|
PeeringMeshConfig Peering = 5;
|
||||||
uint64 Hash = 7;
|
uint64 Hash = 7;
|
||||||
|
bool ValidateClusters = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mog annotation:
|
// mog annotation:
|
||||||
|
|
|
@ -336,6 +336,17 @@ Note that the Kubernetes example does not include a `partition` field. Configura
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'ValidateClusters',
|
||||||
|
type: 'bool: false',
|
||||||
|
description:
|
||||||
|
`Controls whether the clusters the route table refers to are validated. The default value is false. When set to
|
||||||
|
false and a route refers to a cluster that does not exist, the route table loads and routing to a non-existent
|
||||||
|
cluster results in a 404. When set to true and the route is set to a cluster that do not exist, the route table
|
||||||
|
will not load. For more information, refer to
|
||||||
|
[HTTP route configuration in the Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto#envoy-v3-api-field-config-route-v3-routeconfiguration-validate-clusters)
|
||||||
|
for more details. `,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'TLS',
|
name: 'TLS',
|
||||||
type: 'TLSConfig: <optional>',
|
type: 'TLSConfig: <optional>',
|
||||||
|
|
Loading…
Reference in New Issue