K8s: Update from v0.31.3 to v0.32.0 (#98507)

This commit is contained in:
Ryan McKinley
2025-01-06 18:20:35 +03:00
committed by GitHub
parent 085dac8206
commit 6683cdc082
57 changed files with 615 additions and 824 deletions
@@ -5,8 +5,8 @@
package versioned
import (
"fmt"
"net/http"
fmt "fmt"
http "net/http"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/typed/aggregation/v0alpha1"
discovery "k8s.io/client-go/discovery"
@@ -5,10 +5,10 @@
package v0alpha1
import (
"net/http"
http "net/http"
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
"github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/scheme"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
scheme "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
@@ -71,10 +71,10 @@ func New(c rest.Interface) *AggregationV0alpha1Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v0alpha1.SchemeGroupVersion
gv := aggregationv0alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
@@ -5,10 +5,10 @@
package v0alpha1
import (
"context"
context "context"
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/aggregation/v0alpha1"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
applyconfigurationaggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/aggregation/v0alpha1"
scheme "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@@ -24,36 +24,37 @@ type DataPlaneServicesGetter interface {
// DataPlaneServiceInterface has methods to work with DataPlaneService resources.
type DataPlaneServiceInterface interface {
Create(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.CreateOptions) (*v0alpha1.DataPlaneService, error)
Update(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.UpdateOptions) (*v0alpha1.DataPlaneService, error)
Create(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneService, opts v1.CreateOptions) (*aggregationv0alpha1.DataPlaneService, error)
Update(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneService, opts v1.UpdateOptions) (*aggregationv0alpha1.DataPlaneService, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.UpdateOptions) (*v0alpha1.DataPlaneService, error)
UpdateStatus(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneService, opts v1.UpdateOptions) (*aggregationv0alpha1.DataPlaneService, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v0alpha1.DataPlaneService, error)
List(ctx context.Context, opts v1.ListOptions) (*v0alpha1.DataPlaneServiceList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*aggregationv0alpha1.DataPlaneService, error)
List(ctx context.Context, opts v1.ListOptions) (*aggregationv0alpha1.DataPlaneServiceList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.DataPlaneService, err error)
Apply(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.DataPlaneService, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *aggregationv0alpha1.DataPlaneService, err error)
Apply(ctx context.Context, dataPlaneService *applyconfigurationaggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *aggregationv0alpha1.DataPlaneService, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.DataPlaneService, err error)
ApplyStatus(ctx context.Context, dataPlaneService *applyconfigurationaggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *aggregationv0alpha1.DataPlaneService, err error)
DataPlaneServiceExpansion
}
// dataPlaneServices implements DataPlaneServiceInterface
type dataPlaneServices struct {
*gentype.ClientWithListAndApply[*v0alpha1.DataPlaneService, *v0alpha1.DataPlaneServiceList, *aggregationv0alpha1.DataPlaneServiceApplyConfiguration]
*gentype.ClientWithListAndApply[*aggregationv0alpha1.DataPlaneService, *aggregationv0alpha1.DataPlaneServiceList, *applyconfigurationaggregationv0alpha1.DataPlaneServiceApplyConfiguration]
}
// newDataPlaneServices returns a DataPlaneServices
func newDataPlaneServices(c *AggregationV0alpha1Client) *dataPlaneServices {
return &dataPlaneServices{
gentype.NewClientWithListAndApply[*v0alpha1.DataPlaneService, *v0alpha1.DataPlaneServiceList, *aggregationv0alpha1.DataPlaneServiceApplyConfiguration](
gentype.NewClientWithListAndApply[*aggregationv0alpha1.DataPlaneService, *aggregationv0alpha1.DataPlaneServiceList, *applyconfigurationaggregationv0alpha1.DataPlaneServiceApplyConfiguration](
"dataplaneservices",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *v0alpha1.DataPlaneService { return &v0alpha1.DataPlaneService{} },
func() *v0alpha1.DataPlaneServiceList { return &v0alpha1.DataPlaneServiceList{} }),
func() *aggregationv0alpha1.DataPlaneService { return &aggregationv0alpha1.DataPlaneService{} },
func() *aggregationv0alpha1.DataPlaneServiceList { return &aggregationv0alpha1.DataPlaneServiceList{} },
),
}
}
@@ -15,7 +15,7 @@ type FakeAggregationV0alpha1 struct {
}
func (c *FakeAggregationV0alpha1) DataPlaneServices() v0alpha1.DataPlaneServiceInterface {
return &FakeDataPlaneServices{c}
return newFakeDataPlaneServices(c)
}
// RESTClient returns a RESTClient that is used to communicate
@@ -5,168 +5,35 @@
package fake
import (
"context"
json "encoding/json"
"fmt"
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/aggregation/v0alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
typedaggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/clientset/versioned/typed/aggregation/v0alpha1"
gentype "k8s.io/client-go/gentype"
)
// FakeDataPlaneServices implements DataPlaneServiceInterface
type FakeDataPlaneServices struct {
// fakeDataPlaneServices implements DataPlaneServiceInterface
type fakeDataPlaneServices struct {
*gentype.FakeClientWithListAndApply[*v0alpha1.DataPlaneService, *v0alpha1.DataPlaneServiceList, *aggregationv0alpha1.DataPlaneServiceApplyConfiguration]
Fake *FakeAggregationV0alpha1
}
var dataplaneservicesResource = v0alpha1.SchemeGroupVersion.WithResource("dataplaneservices")
var dataplaneservicesKind = v0alpha1.SchemeGroupVersion.WithKind("DataPlaneService")
// Get takes name of the dataPlaneService, and returns the corresponding dataPlaneService object, and an error if there is any.
func (c *FakeDataPlaneServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.DataPlaneService, err error) {
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootGetActionWithOptions(dataplaneservicesResource, name, options), emptyResult)
if obj == nil {
return emptyResult, err
func newFakeDataPlaneServices(fake *FakeAggregationV0alpha1) typedaggregationv0alpha1.DataPlaneServiceInterface {
return &fakeDataPlaneServices{
gentype.NewFakeClientWithListAndApply[*v0alpha1.DataPlaneService, *v0alpha1.DataPlaneServiceList, *aggregationv0alpha1.DataPlaneServiceApplyConfiguration](
fake.Fake,
"",
v0alpha1.SchemeGroupVersion.WithResource("dataplaneservices"),
v0alpha1.SchemeGroupVersion.WithKind("DataPlaneService"),
func() *v0alpha1.DataPlaneService { return &v0alpha1.DataPlaneService{} },
func() *v0alpha1.DataPlaneServiceList { return &v0alpha1.DataPlaneServiceList{} },
func(dst, src *v0alpha1.DataPlaneServiceList) { dst.ListMeta = src.ListMeta },
func(list *v0alpha1.DataPlaneServiceList) []*v0alpha1.DataPlaneService {
return gentype.ToPointerSlice(list.Items)
},
func(list *v0alpha1.DataPlaneServiceList, items []*v0alpha1.DataPlaneService) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v0alpha1.DataPlaneService), err
}
// List takes label and field selectors, and returns the list of DataPlaneServices that match those selectors.
func (c *FakeDataPlaneServices) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.DataPlaneServiceList, err error) {
emptyResult := &v0alpha1.DataPlaneServiceList{}
obj, err := c.Fake.
Invokes(testing.NewRootListActionWithOptions(dataplaneservicesResource, dataplaneservicesKind, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v0alpha1.DataPlaneServiceList{ListMeta: obj.(*v0alpha1.DataPlaneServiceList).ListMeta}
for _, item := range obj.(*v0alpha1.DataPlaneServiceList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested dataPlaneServices.
func (c *FakeDataPlaneServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchActionWithOptions(dataplaneservicesResource, opts))
}
// Create takes the representation of a dataPlaneService and creates it. Returns the server's representation of the dataPlaneService, and an error, if there is any.
func (c *FakeDataPlaneServices) Create(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.CreateOptions) (result *v0alpha1.DataPlaneService, err error) {
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateActionWithOptions(dataplaneservicesResource, dataPlaneService, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}
// Update takes the representation of a dataPlaneService and updates it. Returns the server's representation of the dataPlaneService, and an error, if there is any.
func (c *FakeDataPlaneServices) Update(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.UpdateOptions) (result *v0alpha1.DataPlaneService, err error) {
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateActionWithOptions(dataplaneservicesResource, dataPlaneService, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDataPlaneServices) UpdateStatus(ctx context.Context, dataPlaneService *v0alpha1.DataPlaneService, opts v1.UpdateOptions) (result *v0alpha1.DataPlaneService, err error) {
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(dataplaneservicesResource, "status", dataPlaneService, opts), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}
// Delete takes name of the dataPlaneService and deletes it. Returns an error if one occurs.
func (c *FakeDataPlaneServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(dataplaneservicesResource, name, opts), &v0alpha1.DataPlaneService{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDataPlaneServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionActionWithOptions(dataplaneservicesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v0alpha1.DataPlaneServiceList{})
return err
}
// Patch applies the patch and returns the patched dataPlaneService.
func (c *FakeDataPlaneServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.DataPlaneService, err error) {
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceActionWithOptions(dataplaneservicesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied dataPlaneService.
func (c *FakeDataPlaneServices) Apply(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.DataPlaneService, err error) {
if dataPlaneService == nil {
return nil, fmt.Errorf("dataPlaneService provided to Apply must not be nil")
}
data, err := json.Marshal(dataPlaneService)
if err != nil {
return nil, err
}
name := dataPlaneService.Name
if name == nil {
return nil, fmt.Errorf("dataPlaneService.Name must be provided to Apply")
}
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceActionWithOptions(dataplaneservicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDataPlaneServices) ApplyStatus(ctx context.Context, dataPlaneService *aggregationv0alpha1.DataPlaneServiceApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.DataPlaneService, err error) {
if dataPlaneService == nil {
return nil, fmt.Errorf("dataPlaneService provided to Apply must not be nil")
}
data, err := json.Marshal(dataPlaneService)
if err != nil {
return nil, err
}
name := dataPlaneService.Name
if name == nil {
return nil, fmt.Errorf("dataPlaneService.Name must be provided to Apply")
}
emptyResult := &v0alpha1.DataPlaneService{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceActionWithOptions(dataplaneservicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
return emptyResult, err
}
return obj.(*v0alpha1.DataPlaneService), err
}