From be751915830db8728781907f38f46545b92e0ea3 Mon Sep 17 00:00:00 2001 From: Rafael da Fonseca Date: Thu, 24 Oct 2024 21:22:59 +0100 Subject: [PATCH] fix watch-cache flag --- nodeup/pkg/model/kube_apiserver_test.go | 3 ++- pkg/apis/kops/componentconfig.go | 2 +- pkg/apis/kops/v1alpha2/componentconfig.go | 2 +- pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go | 5 +++++ pkg/apis/kops/v1alpha3/componentconfig.go | 2 +- pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go | 5 +++++ pkg/apis/kops/zz_generated.deepcopy.go | 5 +++++ 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/nodeup/pkg/model/kube_apiserver_test.go b/nodeup/pkg/model/kube_apiserver_test.go index 57d4ca2c34116..4937e0287439e 100644 --- a/nodeup/pkg/model/kube_apiserver_test.go +++ b/nodeup/pkg/model/kube_apiserver_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/kops/pkg/flagbuilder" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/util/pkg/architectures" + "k8s.io/utils/pointer" ) func Test_KubeAPIServer_BuildFlags(t *testing.T) { @@ -92,7 +93,7 @@ func Test_KubeAPIServer_BuildFlags(t *testing.T) { }, { kops.KubeAPIServerConfig{ - WatchCache: false, + WatchCache: pointer.Bool(false), }, "--secure-port=0 --watch-cache=false", }, diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 03a471b33b2c5..f1ec517829c62 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -488,7 +488,7 @@ type KubeAPIServerConfig struct { MinRequestTimeout *int32 `json:"minRequestTimeout,omitempty" flag:"min-request-timeout"` // Used to disable watch caching in the apiserver, defaults to enabling caching by omission - WatchCache bool `json:"watchCache,omitempty" flag:"watch-cache"` + WatchCache *bool `json:"watchCache,omitempty" flag:"watch-cache"` // Set the watch-cache-sizes parameter for the apiserver // The only meaningful value is setting to 0, which disable caches for specific object types. diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index f8d335d23cab2..7f1a584a135d1 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -495,7 +495,7 @@ type KubeAPIServerConfig struct { MinRequestTimeout *int32 `json:"minRequestTimeout,omitempty" flag:"min-request-timeout"` // Used to disable watch caching in the apiserver, defaults to enabling caching by omission - WatchCache bool `json:"watchCache,omitempty" flag:"watch-cache"` + WatchCache *bool `json:"watchCache,omitempty" flag:"watch-cache"` // Set the watch-cache-sizes parameter for the apiserver // The only meaningful value is setting to 0, which disable caches for specific object types. diff --git a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go index c7c2c815059d4..fc07374edeacf 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go @@ -3330,6 +3330,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) { *out = new(int32) **out = **in } + if in.WatchCache != nil { + in, out := &in.WatchCache, &out.WatchCache + *out = new(bool) + **out = **in + } if in.WatchCacheSizes != nil { in, out := &in.WatchCacheSizes, &out.WatchCacheSizes *out = make([]string, len(*in)) diff --git a/pkg/apis/kops/v1alpha3/componentconfig.go b/pkg/apis/kops/v1alpha3/componentconfig.go index 34e28846bb071..91001c11fe4fd 100644 --- a/pkg/apis/kops/v1alpha3/componentconfig.go +++ b/pkg/apis/kops/v1alpha3/componentconfig.go @@ -486,7 +486,7 @@ type KubeAPIServerConfig struct { MinRequestTimeout *int32 `json:"minRequestTimeout,omitempty" flag:"min-request-timeout"` // Used to disable watch caching in the apiserver, defaults to enabling caching by omission - WatchCache bool `json:"watchCache,omitempty" flag:"watch-cache"` + WatchCache *bool `json:"watchCache,omitempty" flag:"watch-cache"` // Set the watch-cache-sizes parameter for the apiserver // The only meaningful value is setting to 0, which disable caches for specific object types. diff --git a/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go index b54cbf7915a26..8788745fc9cfe 100644 --- a/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go @@ -3304,6 +3304,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) { *out = new(int32) **out = **in } + if in.WatchCache != nil { + in, out := &in.WatchCache, &out.WatchCache + *out = new(bool) + **out = **in + } if in.WatchCacheSizes != nil { in, out := &in.WatchCacheSizes, &out.WatchCacheSizes *out = make([]string, len(*in)) diff --git a/pkg/apis/kops/zz_generated.deepcopy.go b/pkg/apis/kops/zz_generated.deepcopy.go index a3c515392753d..aca28f0979e3d 100644 --- a/pkg/apis/kops/zz_generated.deepcopy.go +++ b/pkg/apis/kops/zz_generated.deepcopy.go @@ -3407,6 +3407,11 @@ func (in *KubeAPIServerConfig) DeepCopyInto(out *KubeAPIServerConfig) { *out = new(int32) **out = **in } + if in.WatchCache != nil { + in, out := &in.WatchCache, &out.WatchCache + *out = new(bool) + **out = **in + } if in.WatchCacheSizes != nil { in, out := &in.WatchCacheSizes, &out.WatchCacheSizes *out = make([]string, len(*in))