Chore: Update k8s.io to v0.33.1 (#105307)

This commit is contained in:
Ryan McKinley
2025-05-28 00:13:18 +03:00
committed by GitHub
parent b11be2f37d
commit d4c446f42c
63 changed files with 689 additions and 524 deletions
@@ -9,6 +9,7 @@ import (
clientset "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/typed/aggregation/v0alpha1"
fakeaggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/typed/aggregation/v0alpha1/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
@@ -36,9 +37,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
}
@@ -85,9 +90,13 @@ func NewClientset(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
}
@@ -31,9 +31,7 @@ func (c *AggregationV0alpha1Client) DataPlaneServices() DataPlaneServiceInterfac
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*AggregationV0alpha1Client, 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
@@ -45,9 +43,7 @@ func NewForConfig(c *rest.Config) (*AggregationV0alpha1Client, error) {
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AggregationV0alpha1Client, 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
@@ -70,7 +66,7 @@ func New(c rest.Interface) *AggregationV0alpha1Client {
return &AggregationV0alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
func setConfigDefaults(config *rest.Config) {
gv := aggregationv0alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
@@ -79,8 +75,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
@@ -47,13 +47,25 @@ func NewFilteredDataPlaneServiceInformer(client versioned.Interface, resyncPerio
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AggregationV0alpha1().DataPlaneServices().List(context.TODO(), options)
return client.AggregationV0alpha1().DataPlaneServices().List(context.Background(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AggregationV0alpha1().DataPlaneServices().Watch(context.TODO(), options)
return client.AggregationV0alpha1().DataPlaneServices().Watch(context.Background(), options)
},
ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AggregationV0alpha1().DataPlaneServices().List(ctx, options)
},
WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AggregationV0alpha1().DataPlaneServices().Watch(ctx, options)
},
},
&apisaggregationv0alpha1.DataPlaneService{},