1
0
mirror of https://github.com/rancher/types.git synced 2025-07-15 14:11:36 +00:00

Istios UseSourceIP must be nullable or it fails LBs validation

You can have only one ConsistentHashLB setting, and since useSourceIp
was not nullable and defaulting to false, it was always getting
set. Meaning setting any of the either two would fail validation.
This PR turns bool to pointer, making it nullable.
See: https://archive.istio.io/v1.4/docs/reference/config/networking/destination-rule/#LoadBalancerSettings-ConsistentHashLB
This commit is contained in:
Caleb Bron 2020-05-14 14:38:10 -07:00
parent ee9c76e143
commit 3fe1e8b5b7
2 changed files with 4 additions and 1 deletions

View File

@ -1115,6 +1115,9 @@ func istioTypes(schemas *types.Schemas) *types.Schemas {
MustImport(&Version, istiov1alpha3.VirtualService{}, projectOverride{}, struct {
Status interface{}
}{}).
MustImport(&Version, istiov1alpha3.ConsistentHashLB{}, struct {
UseSourceIP *bool `json:"useSourceIp,omitempty"`
}{}).
MustImport(&Version, istiov1alpha3.DestinationRule{}, projectOverride{}, struct {
Status interface{}
}{}).

View File

@ -12,5 +12,5 @@ type ConsistentHashLB struct {
HTTPCookie *HTTPCookie `json:"httpCookie,omitempty" yaml:"httpCookie,omitempty"`
HTTPHeaderName string `json:"httpHeaderName,omitempty" yaml:"httpHeaderName,omitempty"`
MinimumRingSize int64 `json:"minimumRingSize,omitempty" yaml:"minimumRingSize,omitempty"`
UseSourceIP bool `json:"useSourceIp,omitempty" yaml:"useSourceIp,omitempty"`
UseSourceIP *bool `json:"useSourceIp,omitempty" yaml:"useSourceIp,omitempty"`
}