From 3c2a028630033161f29d7e5d98040470e31e3a30 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Sun, 19 Oct 2025 15:27:04 +0200 Subject: [PATCH 1/6] Run codegen --- .../versioned/fake/clientset_generated.go | 7 ++++++- .../v1/autoscaling.k8s.io_client.go | 12 +++--------- .../v1beta1/autoscaling.k8s.io_client.go | 12 +++--------- .../v1beta2/autoscaling.k8s.io_client.go | 12 +++--------- .../v1alpha1/poc.autoscaling.k8s.io_client.go | 12 +++--------- .../v1/verticalpodautoscaler.go | 16 ++++++++++++++-- .../v1/verticalpodautoscalercheckpoint.go | 16 ++++++++++++++-- .../v1beta1/verticalpodautoscaler.go | 16 ++++++++++++++-- .../v1beta1/verticalpodautoscalercheckpoint.go | 16 ++++++++++++++-- .../v1beta2/verticalpodautoscaler.go | 16 ++++++++++++++-- .../v1beta2/verticalpodautoscalercheckpoint.go | 16 ++++++++++++++-- .../v1alpha1/verticalpodautoscaler.go | 16 ++++++++++++++-- .../v1alpha1/verticalpodautoscalercheckpoint.go | 16 ++++++++++++++-- 13 files changed, 130 insertions(+), 53 deletions(-) diff --git a/vertical-pod-autoscaler/pkg/client/clientset/versioned/fake/clientset_generated.go b/vertical-pod-autoscaler/pkg/client/clientset/versioned/fake/clientset_generated.go index a8b101ba6bb5..a844d751367f 100644 --- a/vertical-pod-autoscaler/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vertical-pod-autoscaler/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -19,6 +19,7 @@ limitations under the License. package fake import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/client/clientset/versioned" @@ -55,9 +56,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } gvr := action.GetResource() ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) + watch, err := o.Watch(gvr, ns, opts) if err != nil { return false, nil, err } diff --git a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1/autoscaling.k8s.io_client.go b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1/autoscaling.k8s.io_client.go index 1ac1f8198c8a..f2932dc05145 100644 --- a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1/autoscaling.k8s.io_client.go +++ b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1/autoscaling.k8s.io_client.go @@ -50,9 +50,7 @@ func (c *AutoscalingV1Client) VerticalPodAutoscalerCheckpoints(namespace string) // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *AutoscalingV1Client { return &AutoscalingV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingk8siov1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta1/autoscaling.k8s.io_client.go b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta1/autoscaling.k8s.io_client.go index 6b63e563d855..72ab4a4424e8 100644 --- a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta1/autoscaling.k8s.io_client.go +++ b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta1/autoscaling.k8s.io_client.go @@ -50,9 +50,7 @@ func (c *AutoscalingV1beta1Client) VerticalPodAutoscalerCheckpoints(namespace st // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *AutoscalingV1beta1Client { return &AutoscalingV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingk8siov1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta2/autoscaling.k8s.io_client.go b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta2/autoscaling.k8s.io_client.go index dd548845f28b..0ed2efcc49d5 100644 --- a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta2/autoscaling.k8s.io_client.go +++ b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/autoscaling.k8s.io/v1beta2/autoscaling.k8s.io_client.go @@ -50,9 +50,7 @@ func (c *AutoscalingV1beta2Client) VerticalPodAutoscalerCheckpoints(namespace st // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV1beta2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *AutoscalingV1beta2Client { return &AutoscalingV1beta2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingk8siov1beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/poc.autoscaling.k8s.io/v1alpha1/poc.autoscaling.k8s.io_client.go b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/poc.autoscaling.k8s.io/v1alpha1/poc.autoscaling.k8s.io_client.go index 23374e70aa5a..fc712073e8ec 100644 --- a/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/poc.autoscaling.k8s.io/v1alpha1/poc.autoscaling.k8s.io_client.go +++ b/vertical-pod-autoscaler/pkg/client/clientset/versioned/typed/poc.autoscaling.k8s.io/v1alpha1/poc.autoscaling.k8s.io_client.go @@ -50,9 +50,7 @@ func (c *PocV1alpha1Client) VerticalPodAutoscalerCheckpoints(namespace string) V // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*PocV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*PocV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PocV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *PocV1alpha1Client { return &PocV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := pocautoscalingk8siov1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscaler.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscaler.go index 854eee4935ad..6bb96d1ca431 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscaler.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerInformer(client versioned.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().VerticalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV1().VerticalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().VerticalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1().VerticalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().VerticalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().VerticalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1.VerticalPodAutoscaler{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscalercheckpoint.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscalercheckpoint.go index 5a6796aebf14..19b6e4f4a352 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscalercheckpoint.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1/verticalpodautoscalercheckpoint.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerCheckpointInformer(client versioned.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).List(context.TODO(), options) + return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().VerticalPodAutoscalerCheckpoints(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1.VerticalPodAutoscalerCheckpoint{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscaler.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscaler.go index 870dea95bb84..d94f9146feb1 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscaler.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerInformer(client versioned.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta1().VerticalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1beta1.VerticalPodAutoscaler{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscalercheckpoint.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscalercheckpoint.go index 73f3dbdbb167..82d4995ffe84 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscalercheckpoint.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta1/verticalpodautoscalercheckpoint.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerCheckpointInformer(client versioned.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).List(context.TODO(), options) + return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta1().VerticalPodAutoscalerCheckpoints(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1beta1.VerticalPodAutoscalerCheckpoint{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscaler.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscaler.go index 2a92542b09fe..e2b1c93ab068 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscaler.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerInformer(client versioned.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta2().VerticalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1beta2.VerticalPodAutoscaler{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscalercheckpoint.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscalercheckpoint.go index 3dcb75699a17..f2eb9c9ea7cc 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscalercheckpoint.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/autoscaling.k8s.io/v1beta2/verticalpodautoscalercheckpoint.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerCheckpointInformer(client versioned.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).List(context.TODO(), options) + return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1beta2().VerticalPodAutoscalerCheckpoints(namespace).Watch(ctx, options) }, }, &apisautoscalingk8siov1beta2.VerticalPodAutoscalerCheckpoint{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscaler.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscaler.go index f3a8746ddad0..df5bd0dbd907 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscaler.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerInformer(client versioned.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.PocV1alpha1().VerticalPodAutoscalers(namespace).List(context.TODO(), options) + return client.PocV1alpha1().VerticalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PocV1alpha1().VerticalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.PocV1alpha1().VerticalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PocV1alpha1().VerticalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PocV1alpha1().VerticalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apispocautoscalingk8siov1alpha1.VerticalPodAutoscaler{}, diff --git a/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscalercheckpoint.go b/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscalercheckpoint.go index 92012987fc95..eab9796af09b 100644 --- a/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscalercheckpoint.go +++ b/vertical-pod-autoscaler/pkg/client/informers/externalversions/poc.autoscaling.k8s.io/v1alpha1/verticalpodautoscalercheckpoint.go @@ -62,13 +62,25 @@ func NewFilteredVerticalPodAutoscalerCheckpointInformer(client versioned.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).List(context.TODO(), options) + return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.TODO(), options) + return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PocV1alpha1().VerticalPodAutoscalerCheckpoints(namespace).Watch(ctx, options) }, }, &apispocautoscalingk8siov1alpha1.VerticalPodAutoscalerCheckpoint{}, From 77654d56955ef068c3fc6825ae3924f21047f256 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Sun, 19 Oct 2025 17:18:50 +0200 Subject: [PATCH 2/6] TEST COMMIT --- hack/for-go-proj.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index eaaff6d71b8f..bba1a021f706 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -19,7 +19,7 @@ set -o pipefail set -o nounset CONTRIB_ROOT="$(dirname ${BASH_SOURCE})/.." -PROJECT_NAMES=(addon-resizer vertical-pod-autoscaler) +PROJECT_NAMES=(vertical-pod-autoscaler) if [[ $# -ne 1 ]]; then echo "missing subcommand: [build|install|test]" @@ -53,6 +53,7 @@ for project_name in ${PROJECT_NAMES[*]}; do godep go test -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e) else go test -count=1 -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e | grep -v cluster-autoscaler/apis) + go clean fi ;; *) @@ -65,6 +66,7 @@ done; if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then pushd ${CONTRIB_ROOT}/vertical-pod-autoscaler/e2e go test -run=None ./... + go clean popd pushd ${CONTRIB_ROOT}/cluster-autoscaler/ # TODO: #8127 - Use default analyzers set by `go test` to include `printf` analyzer. @@ -72,5 +74,6 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then # This doesn't include the `printf` analyzer until cluster-autoscaler libraries are updated. ANALYZERS="atomic,bool,buildtags,directive,errorsas,ifaceassert,nilfunc,slog,stringintconv,tests" go test -count=1 ./... -vet="${ANALYZERS}" + go clean popd fi From 15a5b3da4ea066b020650f7f63cb9bfc338dcf58 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Sun, 19 Oct 2025 19:51:10 +0200 Subject: [PATCH 3/6] Print disk usage --- hack/for-go-proj.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index bba1a021f706..0e4d68af287b 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -42,6 +42,7 @@ case "${CMD}" in esac for project_name in ${PROJECT_NAMES[*]}; do + df -h ( export GO111MODULE=auto project=${CONTRIB_ROOT}/${project_name} @@ -65,6 +66,7 @@ done; if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then pushd ${CONTRIB_ROOT}/vertical-pod-autoscaler/e2e + df -h go test -run=None ./... go clean popd @@ -73,6 +75,7 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then # Default analyzers that go test runs according to https://github.com/golang/go/blob/52624e533fe52329da5ba6ebb9c37712048168e0/src/cmd/go/internal/test/test.go#L649 # This doesn't include the `printf` analyzer until cluster-autoscaler libraries are updated. ANALYZERS="atomic,bool,buildtags,directive,errorsas,ifaceassert,nilfunc,slog,stringintconv,tests" + df -h go test -count=1 ./... -vet="${ANALYZERS}" go clean popd From acf3d8cbec1f135ceeb30ad7e065446346a30213 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Sun, 19 Oct 2025 20:10:36 +0200 Subject: [PATCH 4/6] More debugging --- hack/for-go-proj.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index 0e4d68af287b..6313413d4237 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -21,6 +21,8 @@ set -o nounset CONTRIB_ROOT="$(dirname ${BASH_SOURCE})/.." PROJECT_NAMES=(vertical-pod-autoscaler) +df -h + if [[ $# -ne 1 ]]; then echo "missing subcommand: [build|install|test]" exit 1 @@ -68,6 +70,7 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then pushd ${CONTRIB_ROOT}/vertical-pod-autoscaler/e2e df -h go test -run=None ./... + df -h go clean popd pushd ${CONTRIB_ROOT}/cluster-autoscaler/ @@ -77,6 +80,8 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then ANALYZERS="atomic,bool,buildtags,directive,errorsas,ifaceassert,nilfunc,slog,stringintconv,tests" df -h go test -count=1 ./... -vet="${ANALYZERS}" + df -h go clean popd fi +df -h From 2603fe08f6945413b136e22ff3536298991200f3 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Mon, 20 Oct 2025 19:36:09 +0200 Subject: [PATCH 5/6] Remove clean --- hack/for-go-proj.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index 6313413d4237..9d1d3ad12cd9 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -56,7 +56,6 @@ for project_name in ${PROJECT_NAMES[*]}; do godep go test -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e) else go test -count=1 -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e | grep -v cluster-autoscaler/apis) - go clean fi ;; *) @@ -71,7 +70,6 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then df -h go test -run=None ./... df -h - go clean popd pushd ${CONTRIB_ROOT}/cluster-autoscaler/ # TODO: #8127 - Use default analyzers set by `go test` to include `printf` analyzer. @@ -81,7 +79,6 @@ if [ "${CMD}" = "build" ] || [ "${CMD}" == "test" ]; then df -h go test -count=1 ./... -vet="${ANALYZERS}" df -h - go clean popd fi df -h From 0002f18e21070ec54a8974c16ed29574efba1412 Mon Sep 17 00:00:00 2001 From: Adrian Moisey Date: Mon, 20 Oct 2025 19:58:33 +0200 Subject: [PATCH 6/6] More testing --- hack/for-go-proj.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/for-go-proj.sh b/hack/for-go-proj.sh index 9d1d3ad12cd9..db9b755a1902 100755 --- a/hack/for-go-proj.sh +++ b/hack/for-go-proj.sh @@ -19,7 +19,7 @@ set -o pipefail set -o nounset CONTRIB_ROOT="$(dirname ${BASH_SOURCE})/.." -PROJECT_NAMES=(vertical-pod-autoscaler) +PROJECT_NAMES=(addon-resizer vertical-pod-autoscaler) df -h