pull over Validate_Clusters to api package in 1.15.x (#21631)

pull over Validate_Clusters to api package
pull/21645/head
John Murret 2024-08-22 12:31:41 -06:00 committed by GitHub
parent bca50b0b14
commit 4c52555b99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1076 additions and 1035 deletions

View File

@ -16,6 +16,14 @@ type MeshConfigEntry struct {
// when enabled.
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"`
HTTP *MeshHTTPConfig `json:",omitempty"`

View File

@ -22,6 +22,14 @@ type MeshConfigEntry struct {
// in transparent mode.
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"`
HTTP *MeshHTTPConfig `json:",omitempty"`

View File

@ -1047,6 +1047,7 @@ func MeshConfigToStructs(s *MeshConfig, t *structs.MeshConfigEntry) {
if s.TransparentProxy != nil {
TransparentProxyMeshConfigToStructs(s.TransparentProxy, &t.TransparentProxy)
}
t.ValidateClusters = s.ValidateClusters
if s.TLS != nil {
var x structs.MeshTLSConfig
MeshTLSConfigToStructs(s.TLS, &x)
@ -1074,6 +1075,7 @@ func MeshConfigFromStructs(t *structs.MeshConfigEntry, s *MeshConfig) {
TransparentProxyMeshConfigFromStructs(&t.TransparentProxy, &x)
s.TransparentProxy = &x
}
s.ValidateClusters = t.ValidateClusters
if t.TLS != nil {
var x MeshTLSConfig
MeshTLSConfigFromStructs(t.TLS, &x)

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ message MeshConfig {
map<string, string> Meta = 4;
PeeringMeshConfig Peering = 5;
uint64 Hash = 7;
bool ValidateClusters = 8;
}
// mog annotation:

View File

@ -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',
type: 'TLSConfig: <optional>',