Update K8s deps to 0.28 and update generated code

This commit is contained in:
xing-yang
2023-09-11 20:54:40 +00:00
parent b1c48212ea
commit 95cd3df7ed
19 changed files with 186 additions and 238 deletions

View File

@@ -1,20 +0,0 @@
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -36,9 +35,9 @@ type FakeVolumeGroupSnapshots struct {
ns string ns string
} }
var volumegroupsnapshotsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshots"} var volumegroupsnapshotsResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots")
var volumegroupsnapshotsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshot"} var volumegroupsnapshotsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshot")
// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any. // Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any.
func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) { func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,9 +34,9 @@ type FakeVolumeGroupSnapshotClasses struct {
Fake *FakeGroupsnapshotV1alpha1 Fake *FakeGroupsnapshotV1alpha1
} }
var volumegroupsnapshotclassesResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotclasses"} var volumegroupsnapshotclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses")
var volumegroupsnapshotclassesKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotClass"} var volumegroupsnapshotclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotClass")
// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any. // Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any.
func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) { func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,9 +34,9 @@ type FakeVolumeGroupSnapshotContents struct {
Fake *FakeGroupsnapshotV1alpha1 Fake *FakeGroupsnapshotV1alpha1
} }
var volumegroupsnapshotcontentsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotcontents"} var volumegroupsnapshotcontentsResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents")
var volumegroupsnapshotcontentsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotContent"} var volumegroupsnapshotcontentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotContent")
// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any. // Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any.
func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) { func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -36,25 +35,25 @@ type FakeVolumeSnapshots struct {
ns string ns string
} }
var volumesnapshotsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshots"} var volumesnapshotsResource = v1.SchemeGroupVersion.WithResource("volumesnapshots")
var volumesnapshotsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshot"} var volumesnapshotsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshot")
// Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. // Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any.
func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors.
func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotList, err error) { func (c *FakeVolumeSnapshots) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &volumesnapshotv1.VolumeSnapshotList{}) Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &v1.VolumeSnapshotList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
@@ -64,8 +63,8 @@ func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (re
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotList).ListMeta} list := &v1.VolumeSnapshotList{ListMeta: obj.(*v1.VolumeSnapshotList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotList).Items { for _, item := range obj.(*v1.VolumeSnapshotList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -74,69 +73,69 @@ func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (re
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshots. // Watch returns a watch.Interface that watches the requested volumeSnapshots.
func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts)) InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts))
} }
// Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. // Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any.
func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.CreateOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. // Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any.
func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.UpdateOptions) (*volumesnapshotv1.VolumeSnapshot, error) { func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (*v1.VolumeSnapshot, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &v1.VolumeSnapshot{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts) action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshot. // Patch applies the patch and returns the patched volumeSnapshot.
func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,24 +34,24 @@ type FakeVolumeSnapshotClasses struct {
Fake *FakeSnapshotV1 Fake *FakeSnapshotV1
} }
var volumesnapshotclassesResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshotclasses"} var volumesnapshotclassesResource = v1.SchemeGroupVersion.WithResource("volumesnapshotclasses")
var volumesnapshotclassesKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshotClass"} var volumesnapshotclassesKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotClass")
// Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. // Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any.
func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors.
func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotClassList, err error) { func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotClassList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &volumesnapshotv1.VolumeSnapshotClassList{}) Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &v1.VolumeSnapshotClassList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
@@ -61,8 +60,8 @@ func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOption
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotClassList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotClassList).ListMeta} list := &v1.VolumeSnapshotClassList{ListMeta: obj.(*v1.VolumeSnapshotClassList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotClassList).Items { for _, item := range obj.(*v1.VolumeSnapshotClassList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -71,52 +70,52 @@ func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOption
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshotClasses. // Watch returns a watch.Interface that watches the requested volumeSnapshotClasses.
func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts)) InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts))
} }
// Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. // Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any.
func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *volumesnapshotv1.VolumeSnapshotClass, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.CreateOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. // Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any.
func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *volumesnapshotv1.VolumeSnapshotClass, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &v1.VolumeSnapshotClass{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts) action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotClassList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotClassList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshotClass. // Patch applies the patch and returns the patched volumeSnapshotClass.
func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,24 +34,24 @@ type FakeVolumeSnapshotContents struct {
Fake *FakeSnapshotV1 Fake *FakeSnapshotV1
} }
var volumesnapshotcontentsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshotcontents"} var volumesnapshotcontentsResource = v1.SchemeGroupVersion.WithResource("volumesnapshotcontents")
var volumesnapshotcontentsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshotContent"} var volumesnapshotcontentsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotContent")
// Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. // Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any.
func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors.
func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotContentList, err error) { func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotContentList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &volumesnapshotv1.VolumeSnapshotContentList{}) Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &v1.VolumeSnapshotContentList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
@@ -61,8 +60,8 @@ func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptio
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotContentList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotContentList).ListMeta} list := &v1.VolumeSnapshotContentList{ListMeta: obj.(*v1.VolumeSnapshotContentList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotContentList).Items { for _, item := range obj.(*v1.VolumeSnapshotContentList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -71,63 +70,63 @@ func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptio
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshotContents. // Watch returns a watch.Interface that watches the requested volumeSnapshotContents.
func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts)) InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts))
} }
// Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. // Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any.
func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.CreateOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. // Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any.
func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.UpdateOptions) (*volumesnapshotv1.VolumeSnapshotContent, error) { func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (*v1.VolumeSnapshotContent, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &v1.VolumeSnapshotContent{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts) action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotContentList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotContentList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshotContent. // Patch applies the patch and returns the patched volumeSnapshotContent.
func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }

View File

@@ -1,12 +1,12 @@
module github.com/kubernetes-csi/external-snapshotter/client/v6 module github.com/kubernetes-csi/external-snapshotter/client/v6
go 1.19 go 1.20
require ( require (
k8s.io/api v0.26.0 k8s.io/api v0.28.0
k8s.io/apimachinery v0.26.0 k8s.io/apimachinery v0.28.0
k8s.io/client-go v0.26.0 k8s.io/client-go v0.28.0
k8s.io/code-generator v0.26.0 k8s.io/code-generator v0.28.1
) )
require ( require (

View File

@@ -26,7 +26,7 @@ Make sure to run this script after making changes to /client/apis/volumesnapshot
``` ```
* Checkout latest release version * Checkout latest release version
```bash ```bash
git checkout v0.26.1 git checkout v0.28.1
``` ```
* Ensure the file `generate-groups.sh` exists * Ensure the file `generate-groups.sh` exists

View File

@@ -167,7 +167,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref
return res return res
} }
// InternalInformerFor returns the SharedIndexInformer for obj using an internal // InformerFor returns the SharedIndexInformer for obj using an internal
// client. // client.
func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
f.lock.Lock() f.lock.Lock()
@@ -240,7 +240,7 @@ type SharedInformerFactory interface {
// ForResource gives generic access to a shared informer of the matching type. // ForResource gives generic access to a shared informer of the matching type.
ForResource(resource schema.GroupVersionResource) (GenericInformer, error) ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
// InternalInformerFor returns the SharedIndexInformer for obj using an internal // InformerFor returns the SharedIndexInformer for obj using an internal
// client. // client.
InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer

View File

@@ -1,20 +0,0 @@
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -36,9 +35,9 @@ type FakeVolumeGroupSnapshots struct {
ns string ns string
} }
var volumegroupsnapshotsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshots"} var volumegroupsnapshotsResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots")
var volumegroupsnapshotsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshot"} var volumegroupsnapshotsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshot")
// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any. // Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any.
func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) { func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,9 +34,9 @@ type FakeVolumeGroupSnapshotClasses struct {
Fake *FakeGroupsnapshotV1alpha1 Fake *FakeGroupsnapshotV1alpha1
} }
var volumegroupsnapshotclassesResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotclasses"} var volumegroupsnapshotclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses")
var volumegroupsnapshotclassesKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotClass"} var volumegroupsnapshotclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotClass")
// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any. // Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any.
func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) { func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {

View File

@@ -24,7 +24,6 @@ import (
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1" v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,9 +34,9 @@ type FakeVolumeGroupSnapshotContents struct {
Fake *FakeGroupsnapshotV1alpha1 Fake *FakeGroupsnapshotV1alpha1
} }
var volumegroupsnapshotcontentsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotcontents"} var volumegroupsnapshotcontentsResource = v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents")
var volumegroupsnapshotcontentsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotContent"} var volumegroupsnapshotcontentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotContent")
// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any. // Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any.
func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) { func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -36,25 +35,25 @@ type FakeVolumeSnapshots struct {
ns string ns string
} }
var volumesnapshotsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshots"} var volumesnapshotsResource = v1.SchemeGroupVersion.WithResource("volumesnapshots")
var volumesnapshotsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshot"} var volumesnapshotsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshot")
// Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. // Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any.
func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors.
func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotList, err error) { func (c *FakeVolumeSnapshots) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &volumesnapshotv1.VolumeSnapshotList{}) Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &v1.VolumeSnapshotList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
@@ -64,8 +63,8 @@ func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (re
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotList).ListMeta} list := &v1.VolumeSnapshotList{ListMeta: obj.(*v1.VolumeSnapshotList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotList).Items { for _, item := range obj.(*v1.VolumeSnapshotList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -74,69 +73,69 @@ func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (re
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshots. // Watch returns a watch.Interface that watches the requested volumeSnapshots.
func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts)) InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts))
} }
// Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. // Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any.
func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.CreateOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. // Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any.
func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *volumesnapshotv1.VolumeSnapshot, opts v1.UpdateOptions) (*volumesnapshotv1.VolumeSnapshot, error) { func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (*v1.VolumeSnapshot, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }
// Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &v1.VolumeSnapshot{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts) action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshot. // Patch applies the patch and returns the patched volumeSnapshot.
func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshot, err error) { func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshot, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshot{}) Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &v1.VolumeSnapshot{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshot), err return obj.(*v1.VolumeSnapshot), err
} }

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,24 +34,24 @@ type FakeVolumeSnapshotClasses struct {
Fake *FakeSnapshotV1 Fake *FakeSnapshotV1
} }
var volumesnapshotclassesResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshotclasses"} var volumesnapshotclassesResource = v1.SchemeGroupVersion.WithResource("volumesnapshotclasses")
var volumesnapshotclassesKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshotClass"} var volumesnapshotclassesKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotClass")
// Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. // Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any.
func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors.
func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotClassList, err error) { func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotClassList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &volumesnapshotv1.VolumeSnapshotClassList{}) Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &v1.VolumeSnapshotClassList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
@@ -61,8 +60,8 @@ func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOption
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotClassList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotClassList).ListMeta} list := &v1.VolumeSnapshotClassList{ListMeta: obj.(*v1.VolumeSnapshotClassList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotClassList).Items { for _, item := range obj.(*v1.VolumeSnapshotClassList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -71,52 +70,52 @@ func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOption
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshotClasses. // Watch returns a watch.Interface that watches the requested volumeSnapshotClasses.
func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts)) InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts))
} }
// Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. // Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any.
func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *volumesnapshotv1.VolumeSnapshotClass, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.CreateOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. // Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any.
func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *volumesnapshotv1.VolumeSnapshotClass, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }
// Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &v1.VolumeSnapshotClass{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts) action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotClassList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotClassList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshotClass. // Patch applies the patch and returns the patched volumeSnapshotClass.
func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshotClass, err error) { func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotClass, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshotClass{}) Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &v1.VolumeSnapshotClass{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotClass), err return obj.(*v1.VolumeSnapshotClass), err
} }

View File

@@ -21,10 +21,9 @@ package fake
import ( import (
"context" "context"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" v1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
@@ -35,24 +34,24 @@ type FakeVolumeSnapshotContents struct {
Fake *FakeSnapshotV1 Fake *FakeSnapshotV1
} }
var volumesnapshotcontentsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1", Resource: "volumesnapshotcontents"} var volumesnapshotcontentsResource = v1.SchemeGroupVersion.WithResource("volumesnapshotcontents")
var volumesnapshotcontentsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1", Kind: "VolumeSnapshotContent"} var volumesnapshotcontentsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotContent")
// Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. // Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any.
func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors. // List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors.
func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *volumesnapshotv1.VolumeSnapshotContentList, err error) { func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotContentList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &volumesnapshotv1.VolumeSnapshotContentList{}) Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &v1.VolumeSnapshotContentList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
@@ -61,8 +60,8 @@ func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptio
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &volumesnapshotv1.VolumeSnapshotContentList{ListMeta: obj.(*volumesnapshotv1.VolumeSnapshotContentList).ListMeta} list := &v1.VolumeSnapshotContentList{ListMeta: obj.(*v1.VolumeSnapshotContentList).ListMeta}
for _, item := range obj.(*volumesnapshotv1.VolumeSnapshotContentList).Items { for _, item := range obj.(*v1.VolumeSnapshotContentList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
@@ -71,63 +70,63 @@ func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptio
} }
// Watch returns a watch.Interface that watches the requested volumeSnapshotContents. // Watch returns a watch.Interface that watches the requested volumeSnapshotContents.
func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake. return c.Fake.
InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts)) InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts))
} }
// Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. // Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any.
func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.CreateOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.CreateOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. // Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any.
func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.UpdateOptions) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *volumesnapshotv1.VolumeSnapshotContent, opts v1.UpdateOptions) (*volumesnapshotv1.VolumeSnapshotContent, error) { func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (*v1.VolumeSnapshotContent, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }
// Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs. // Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &v1.VolumeSnapshotContent{})
return err return err
} }
// DeleteCollection deletes a collection of objects. // DeleteCollection deletes a collection of objects.
func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts) action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts)
_, err := c.Fake.Invokes(action, &volumesnapshotv1.VolumeSnapshotContentList{}) _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotContentList{})
return err return err
} }
// Patch applies the patch and returns the patched volumeSnapshotContent. // Patch applies the patch and returns the patched volumeSnapshotContent.
func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *volumesnapshotv1.VolumeSnapshotContent, err error) { func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotContent, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &volumesnapshotv1.VolumeSnapshotContent{}) Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &v1.VolumeSnapshotContent{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*volumesnapshotv1.VolumeSnapshotContent), err return obj.(*v1.VolumeSnapshotContent), err
} }

View File

@@ -167,7 +167,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref
return res return res
} }
// InternalInformerFor returns the SharedIndexInformer for obj using an internal // InformerFor returns the SharedIndexInformer for obj using an internal
// client. // client.
func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
f.lock.Lock() f.lock.Lock()
@@ -240,7 +240,7 @@ type SharedInformerFactory interface {
// ForResource gives generic access to a shared informer of the matching type. // ForResource gives generic access to a shared informer of the matching type.
ForResource(resource schema.GroupVersionResource) (GenericInformer, error) ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
// InternalInformerFor returns the SharedIndexInformer for obj using an internal // InformerFor returns the SharedIndexInformer for obj using an internal
// client. // client.
InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer

2
vendor/modules.txt vendored
View File

@@ -102,7 +102,7 @@ github.com/kubernetes-csi/csi-lib-utils/rpc
github.com/kubernetes-csi/csi-test/v4/driver github.com/kubernetes-csi/csi-test/v4/driver
github.com/kubernetes-csi/csi-test/v4/utils github.com/kubernetes-csi/csi-test/v4/utils
# github.com/kubernetes-csi/external-snapshotter/client/v6 v6.1.0 => ./client # github.com/kubernetes-csi/external-snapshotter/client/v6 v6.1.0 => ./client
## explicit; go 1.19 ## explicit; go 1.20
github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1 github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1
github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1 github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1
github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned