From 3fe1e8b5b70516ff0ba6b6ea627d034e4c678711 Mon Sep 17 00:00:00 2001 From: Caleb Bron Date: Thu, 14 May 2020 14:38:10 -0700 Subject: [PATCH] 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 --- apis/project.cattle.io/v3/schema/schema.go | 3 +++ client/project/v3/zz_generated_consistent_hash_lb.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/project.cattle.io/v3/schema/schema.go b/apis/project.cattle.io/v3/schema/schema.go index e856c198..885b1b76 100644 --- a/apis/project.cattle.io/v3/schema/schema.go +++ b/apis/project.cattle.io/v3/schema/schema.go @@ -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{} }{}). diff --git a/client/project/v3/zz_generated_consistent_hash_lb.go b/client/project/v3/zz_generated_consistent_hash_lb.go index f248a849..a8b4c5a4 100644 --- a/client/project/v3/zz_generated_consistent_hash_lb.go +++ b/client/project/v3/zz_generated_consistent_hash_lb.go @@ -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"` }