add failover policy to ProxyConfigEntry in api (#16759)

* add failover policy to ProxyConfigEntry in api

* update docs
This commit is contained in:
malizz 2023-03-24 12:03:00 -07:00 committed by GitHub
parent dff21eeda4
commit 83968aed9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 9 deletions

View File

@ -312,15 +312,16 @@ func (s *ServiceConfigEntry) GetModifyIndex() uint64 { return s.ModifyIndex
type ProxyConfigEntry struct {
Kind string
Name string
Partition string `json:",omitempty"`
Namespace string `json:",omitempty"`
Mode ProxyMode `json:",omitempty"`
TransparentProxy *TransparentProxyConfig `json:",omitempty" alias:"transparent_proxy"`
Config map[string]interface{} `json:",omitempty"`
MeshGateway MeshGatewayConfig `json:",omitempty" alias:"mesh_gateway"`
Expose ExposeConfig `json:",omitempty"`
AccessLogs *AccessLogsConfig `json:",omitempty" alias:"access_logs"`
EnvoyExtensions []EnvoyExtension `json:",omitempty" alias:"envoy_extensions"`
Partition string `json:",omitempty"`
Namespace string `json:",omitempty"`
Mode ProxyMode `json:",omitempty"`
TransparentProxy *TransparentProxyConfig `json:",omitempty" alias:"transparent_proxy"`
Config map[string]interface{} `json:",omitempty"`
MeshGateway MeshGatewayConfig `json:",omitempty" alias:"mesh_gateway"`
Expose ExposeConfig `json:",omitempty"`
AccessLogs *AccessLogsConfig `json:",omitempty" alias:"access_logs"`
EnvoyExtensions []EnvoyExtension `json:",omitempty" alias:"envoy_extensions"`
FailoverPolicy *ServiceResolverFailoverPolicy `json:",omitempty" alias:"failover_policy"`
Meta map[string]string `json:",omitempty"`
CreateIndex uint64

View File

@ -408,6 +408,9 @@ func TestDecodeConfigEntry(t *testing.T) {
"Type": "file",
"Path": "/tmp/logs.txt",
"TextFormat": "[%START_TIME%]"
},
"FailoverPolicy": {
"Mode": "default"
}
}
`,
@ -440,6 +443,9 @@ func TestDecodeConfigEntry(t *testing.T) {
Path: "/tmp/logs.txt",
TextFormat: "[%START_TIME%]",
},
FailoverPolicy: &ServiceResolverFailoverPolicy{
Mode: "default",
},
},
},
{

View File

@ -472,6 +472,19 @@ spec:
},
],
},
{
name: 'FailoverPolicy',
type: 'ServiceResolverFailoverPolicy: <optional>',
description: `Policy specifies the exact mechanism used for failover.
Added in v1.16.0.`,
children: [
{
name: 'Mode',
type: 'string: ""',
description: 'One of `""`, `default`, or `order-by-locality`.',
},
],
},
{
name: 'AccessLogs',
type: 'AccessLogsConfig: <optional>',