e2e: update snapshot to v1beta1

updating the snapshot client and
test to use v1beta1 client and API.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-12-12 13:31:29 +01:00 committed by mergify[bot]
parent 5bfff89e04
commit a17fef07e6
16 changed files with 202 additions and 192 deletions

View File

@ -18,9 +18,10 @@ package e2e
import (
"context"
"crypto/sha256"
"fmt"
groupsnapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
groupsnapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework"
)
@ -78,16 +79,32 @@ func (c *cephFSVolumeGroupSnapshot) ValidateResourcesForCreate(vgs *groupsnapapi
return fmt.Errorf("failed getting cephFS metadata pool name: %w", err)
}
sourcePVCCount := len(vgs.Status.PVCVolumeSnapshotRefList)
vgsc, err := c.groupclient.VolumeGroupSnapshotContents().Get(
ctx,
*vgs.Status.BoundVolumeGroupSnapshotContentName,
metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get VolumeGroupSnapshotContent: %w", err)
}
sourcePVCCount := len(vgsc.Status.VolumeSnapshotHandlePairList)
// we are creating clones for each source PVC
clonePVCCount := len(vgs.Status.PVCVolumeSnapshotRefList)
clonePVCCount := len(vgsc.Status.VolumeSnapshotHandlePairList)
totalPVCCount := sourcePVCCount + clonePVCCount
validateSubvolumeCount(c.framework, totalPVCCount, fileSystemName, subvolumegroup)
// we are creating 1 snapshot for each source PVC, validate the snapshot count
for _, pvcSnap := range vgs.Status.PVCVolumeSnapshotRefList {
for _, snapshot := range vgsc.Status.VolumeSnapshotHandlePairList {
volumeHandle := snapshot.VolumeHandle
volumeSnapshotName := fmt.Sprintf("snapshot-%x", sha256.Sum256([]byte(
string(vgsc.UID)+volumeHandle)))
volumeSnapshot, err := c.snapClient.VolumeSnapshots(vgs.Namespace).Get(ctx, volumeSnapshotName, metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get VolumeSnapshot: %w", err)
}
pvcName := *volumeSnapshot.Spec.Source.PersistentVolumeClaimName
pvc, err := c.framework.ClientSet.CoreV1().PersistentVolumeClaims(vgs.Namespace).Get(ctx,
pvcSnap.PersistentVolumeClaimRef.Name,
pvcName,
metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get PVC: %w", err)
@ -165,8 +182,16 @@ func (rvgs *rbdVolumeGroupSnapshot) GetVolumeGroupSnapshotClass() (*groupsnapapi
}
func (rvgs *rbdVolumeGroupSnapshot) ValidateResourcesForCreate(vgs *groupsnapapi.VolumeGroupSnapshot) error {
sourcePVCCount := len(vgs.Status.PVCVolumeSnapshotRefList)
clonePVCCount := len(vgs.Status.PVCVolumeSnapshotRefList)
vgsc, err := rvgs.groupclient.VolumeGroupSnapshotContents().Get(
context.TODO(),
*vgs.Status.BoundVolumeGroupSnapshotContentName,
metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get VolumeGroupSnapshotContent: %w", err)
}
sourcePVCCount := len(vgsc.Status.VolumeSnapshotHandlePairList)
clonePVCCount := len(vgsc.Status.VolumeSnapshotHandlePairList)
totalPVCCount := sourcePVCCount + clonePVCCount
validateOmapCount(rvgs.framework, totalPVCCount, rbdType, defaultRBDPool, volumesType)

View File

@ -18,12 +18,14 @@ package e2e
import (
"context"
"crypto/sha256"
"fmt"
"time"
groupsnapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
groupsnapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
groupsnapclient "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1"
groupsnapclient "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1"
snapclient "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1"
v1 "k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
@ -75,7 +77,8 @@ type VolumeGroupSnapshotter interface {
type volumeGroupSnapshotterBase struct {
timeout int
framework *framework.Framework
groupclient *groupsnapclient.GroupsnapshotV1alpha1Client
groupclient *groupsnapclient.GroupsnapshotV1beta1Client
snapClient *snapclient.SnapshotV1Client
storageClassName string
blockPVC bool
totalPVCCount int
@ -96,9 +99,15 @@ func newVolumeGroupSnapshotBase(f *framework.Framework, namespace,
return nil, fmt.Errorf("error creating group snapshot client: %w", err)
}
s, err := snapclient.NewForConfig(config)
if err != nil {
return nil, fmt.Errorf("error creating snapshot client: %w", err)
}
return &volumeGroupSnapshotterBase{
framework: f,
groupclient: c,
snapClient: s,
namespace: namespace,
storageClassName: storageClass,
blockPVC: blockPVC,
@ -160,13 +169,27 @@ func (v *volumeGroupSnapshotterBase) DeletePVCs(pvcs []*v1.PersistentVolumeClaim
func (v *volumeGroupSnapshotterBase) CreatePVCClones(
vgs *groupsnapapi.VolumeGroupSnapshot,
) ([]*v1.PersistentVolumeClaim, error) {
pvcSnapRef := vgs.Status.PVCVolumeSnapshotRefList
groupSnapshotContent, err := v.groupclient.VolumeGroupSnapshotContents().Get(
context.TODO(),
*vgs.Status.BoundVolumeGroupSnapshotContentName,
metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get VolumeGroupSnapshotContent: %w", err)
}
namespace := vgs.Namespace
ctx := context.TODO()
pvcs := make([]*v1.PersistentVolumeClaim, len(pvcSnapRef))
for i, pvcSnap := range pvcSnapRef {
pvcs := make([]*v1.PersistentVolumeClaim, len(groupSnapshotContent.Status.VolumeSnapshotHandlePairList))
for i, snapshot := range groupSnapshotContent.Status.VolumeSnapshotHandlePairList {
volumeHandle := snapshot.VolumeHandle
volumeSnapshotName := fmt.Sprintf("snapshot-%x", sha256.Sum256([]byte(
string(groupSnapshotContent.UID)+volumeHandle)))
volumeSnapshot, err := v.snapClient.VolumeSnapshots(namespace).Get(ctx, volumeSnapshotName, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get VolumeSnapshot: %w", err)
}
pvcName := *volumeSnapshot.Spec.Source.PersistentVolumeClaimName
pvc, err := v.framework.ClientSet.CoreV1().PersistentVolumeClaims(namespace).Get(ctx,
pvcSnap.PersistentVolumeClaimRef.Name,
pvcName,
metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get PVC: %w", err)
@ -179,12 +202,11 @@ func (v *volumeGroupSnapshotterBase) CreatePVCClones(
Spec: *pvc.Spec.DeepCopy(),
}
snap := pvcSnap.VolumeSnapshotRef
apiGroup := snapapi.GroupName
pvcs[i].Spec.DataSource = &v1.TypedLocalObjectReference{
APIGroup: &apiGroup,
Kind: "VolumeSnapshot",
Name: snap.Name,
Name: volumeSnapshot.Name,
}
pvcs[i].Spec.StorageClassName = &v.storageClassName
// cleanup the VolumeName as we are creating a new PVC
@ -263,7 +285,7 @@ func (v *volumeGroupSnapshotterBase) DeletePods(pods []*v1.Pod) error {
return nil
}
func (v volumeGroupSnapshotterBase) CreateVolumeGroupSnapshotClass(
func (v *volumeGroupSnapshotterBase) CreateVolumeGroupSnapshotClass(
groupSnapshotClass *groupsnapapi.VolumeGroupSnapshotClass,
) error {
return wait.PollUntilContextTimeout(
@ -286,7 +308,7 @@ func (v volumeGroupSnapshotterBase) CreateVolumeGroupSnapshotClass(
})
}
func (v volumeGroupSnapshotterBase) CreateVolumeGroupSnapshot(name,
func (v *volumeGroupSnapshotterBase) CreateVolumeGroupSnapshot(name,
volumeGroupSnapshotClassName string, labels map[string]string,
) (*groupsnapapi.VolumeGroupSnapshot, error) {
namespace := v.namespace
@ -356,7 +378,7 @@ func (v volumeGroupSnapshotterBase) CreateVolumeGroupSnapshot(name,
return groupSnapshot, nil
}
func (v volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshot(volumeGroupSnapshotName string) error {
func (v *volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshot(volumeGroupSnapshotName string) error {
namespace := v.namespace
ctx := context.TODO()
err := v.groupclient.VolumeGroupSnapshots(namespace).Delete(
@ -395,7 +417,7 @@ func (v volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshot(volumeGroupSnapsho
})
}
func (v volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshotClass(groupSnapshotClassName string) error {
func (v *volumeGroupSnapshotterBase) DeleteVolumeGroupSnapshotClass(groupSnapshotClassName string) error {
ctx := context.TODO()
err := v.groupclient.VolumeGroupSnapshotClasses().Delete(
ctx, groupSnapshotClassName, metav1.DeleteOptions{})

2
go.mod
View File

@ -18,7 +18,7 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/hashicorp/vault/api v1.15.0
github.com/kubernetes-csi/csi-lib-utils v0.19.0
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
github.com/libopenstorage/secrets v0.0.0-20231011182615-5f4b25ceede1
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.0

4
go.sum
View File

@ -1970,8 +1970,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubernetes-csi/csi-lib-utils v0.19.0 h1:3sT8mL9+St2acyrEtuR7CQ5L78GR4lgsb+sfon9tGfA=
github.com/kubernetes-csi/csi-lib-utils v0.19.0/go.mod h1:lBuMKvoyd8c3EG+itmnVWApLDHnLkU7ibxxZSPuOw0M=
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.0.0/go.mod h1:YBCo4DoEeDndqvAn6eeu0vWM7QdXmHEeI9cFWplmBys=
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0 h1:mjQG0Vakr2h246kEDR85U8y8ZhPgT3bguTCajRa/jaw=
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0/go.mod h1:E3vdYxHj2C2q6qo8/Da4g7P+IcwqRZyy3gJBzYybV9Y=
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 h1:Q3jQ1NkFqv5o+F8dMmHd8SfEmlcwNeo1immFApntEwE=
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0/go.mod h1:E3vdYxHj2C2q6qo8/Da4g7P+IcwqRZyy3gJBzYybV9Y=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=

View File

@ -17,4 +17,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +groupName=groupsnapshot.storage.k8s.io
package v1alpha1
package v1beta1

View File

@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -28,7 +28,7 @@ var (
// AddToScheme adds to scheme
AddToScheme = SchemeBuilder.AddToScheme
// SchemeGroupVersion is the group version used to register these objects.
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
)
func Resource(resource string) schema.GroupResource {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +kubebuilder:object:generate=true
package v1alpha1
package v1beta1
import (
core_v1 "k8s.io/api/core/v1"
@ -90,6 +90,7 @@ type VolumeGroupSnapshotStatus struct {
// The format of this field is a Unix nanoseconds time encoded as an int64.
// On Unix, the command date +%s%N returns the current time in nanoseconds
// since 1970-01-01 00:00:00 UTC.
// This field is updated based on the CreationTime field in VolumeGroupSnapshotContentStatus
// +optional
CreationTime *metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
@ -108,21 +109,6 @@ type VolumeGroupSnapshotStatus struct {
// group snapshot creation. Upon success, this error field will be cleared.
// +optional
Error *snapshotv1.VolumeSnapshotError `json:"error,omitempty" protobuf:"bytes,4,opt,name=error,casttype=VolumeSnapshotError"`
// VolumeSnapshotRefList is the list of PVC and VolumeSnapshot pairs that
// is part of this group snapshot.
// The maximum number of allowed snapshots in the group is 100.
// +optional
PVCVolumeSnapshotRefList []PVCVolumeSnapshotPair `json:"pvcVolumeSnapshotRefList,omitempty" protobuf:"bytes,5,opt,name=pvcVolumeSnapshotRefList"`
}
// PVCVolumeSnapshotPair defines a pair of a PVC reference and a Volume Snapshot Reference
type PVCVolumeSnapshotPair struct {
// PersistentVolumeClaimRef is a reference to the PVC this pair is referring to
PersistentVolumeClaimRef core_v1.LocalObjectReference `json:"persistentVolumeClaimRef,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeClaimRef"`
// VolumeSnapshotRef is a reference to the VolumeSnapshot this pair is referring to
VolumeSnapshotRef core_v1.LocalObjectReference `json:"volumeSnapshotRef,omitempty" protobuf:"bytes,2,opt,name=volumeSnapshotRef"`
}
//+genclient
@ -281,7 +267,6 @@ type VolumeGroupSnapshotContentSpec struct {
// This field is immutable after creation.
// Required.
// +kubebuilder:validation:XValidation:rule="has(self.name) && has(self.__namespace__)",message="both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeGroupSnapshotRef is immutable"
VolumeGroupSnapshotRef core_v1.ObjectReference `json:"volumeGroupSnapshotRef" protobuf:"bytes,1,opt,name=volumeGroupSnapshotRef"`
// DeletionPolicy determines whether this VolumeGroupSnapshotContent and the
@ -340,8 +325,9 @@ type VolumeGroupSnapshotContentStatus struct {
// The format of this field is a Unix nanoseconds time encoded as an int64.
// On Unix, the command date +%s%N returns the current time in nanoseconds
// since 1970-01-01 00:00:00 UTC.
// This field is the source for the CreationTime field in VolumeGroupSnapshotStatus
// +optional
CreationTime *int64 `json:"creationTime,omitempty" protobuf:"varint,2,opt,name=creationTime"`
CreationTime *metav1.Time `json:"creationTime,omitempty" protobuf:"bytes,2,opt,name=creationTime"`
// ReadyToUse indicates if all the individual snapshots in the group are ready to be
// used to restore a group of volumes.
@ -354,21 +340,11 @@ type VolumeGroupSnapshotContentStatus struct {
// +optional
Error *snapshotv1.VolumeSnapshotError `json:"error,omitempty" protobuf:"bytes,4,opt,name=error,casttype=VolumeSnapshotError"`
// PVVolumeSnapshotContentList is the list of pairs of PV and
// VolumeSnapshotContent for this group snapshot
// The maximum number of allowed snapshots in the group is 100.
// VolumeSnapshotHandlePairList is a list of CSI "volume_id" and "snapshot_id"
// pair returned by the CSI driver to identify snapshots and their source volumes
// on the storage system.
// +optional
PVVolumeSnapshotContentList []PVVolumeSnapshotContentPair `json:"pvVolumeSnapshotContentList,omitempty" protobuf:"bytes,5,opt,name=pvVolumeSnapshotContentRefList"`
}
// PVVolumeSnapshotContentPair represent a pair of PV names and
// VolumeSnapshotContent names
type PVVolumeSnapshotContentPair struct {
// PersistentVolumeRef is a reference to the persistent volume resource
PersistentVolumeRef core_v1.LocalObjectReference `json:"persistentVolumeRef,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeRef"`
// VolumeSnapshotContentRef is a reference to the volume snapshot content resource
VolumeSnapshotContentRef core_v1.LocalObjectReference `json:"volumeSnapshotContentRef,omitempty" protobuf:"bytes,2,opt,name=volumeSnapshotContentRef"`
VolumeSnapshotHandlePairList []VolumeSnapshotHandlePair `json:"volumeSnapshotHandlePairList,omitempty" protobuf:"bytes,6,opt,name=volumeSnapshotHandlePairList"`
}
// VolumeGroupSnapshotContentSource represents the CSI source of a group snapshot.
@ -410,3 +386,16 @@ type GroupSnapshotHandles struct {
// Required.
VolumeSnapshotHandles []string `json:"volumeSnapshotHandles" protobuf:"bytes,2,opt,name=volumeSnapshotHandles"`
}
// VolumeSnapshotHandlePair defines a pair of a source volume handle and a snapshot handle
type VolumeSnapshotHandlePair struct {
// VolumeHandle is a unique id returned by the CSI driver to identify a volume
// on the storage system
// Required.
VolumeHandle string `json:"volumeHandle" protobuf:"bytes,1,opt,name=volumeHandle"`
// SnapshotHandle is a unique id returned by the CSI driver to identify a volume
// snapshot on the storage system
// Required.
SnapshotHandle string `json:"snapshotHandle" protobuf:"bytes,2,opt,name=snapshotHandle"`
}

View File

@ -19,7 +19,7 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
import (
v1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
@ -48,42 +48,6 @@ func (in *GroupSnapshotHandles) DeepCopy() *GroupSnapshotHandles {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PVCVolumeSnapshotPair) DeepCopyInto(out *PVCVolumeSnapshotPair) {
*out = *in
out.PersistentVolumeClaimRef = in.PersistentVolumeClaimRef
out.VolumeSnapshotRef = in.VolumeSnapshotRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PVCVolumeSnapshotPair.
func (in *PVCVolumeSnapshotPair) DeepCopy() *PVCVolumeSnapshotPair {
if in == nil {
return nil
}
out := new(PVCVolumeSnapshotPair)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PVVolumeSnapshotContentPair) DeepCopyInto(out *PVVolumeSnapshotContentPair) {
*out = *in
out.PersistentVolumeRef = in.PersistentVolumeRef
out.VolumeSnapshotContentRef = in.VolumeSnapshotContentRef
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PVVolumeSnapshotContentPair.
func (in *PVVolumeSnapshotContentPair) DeepCopy() *PVVolumeSnapshotContentPair {
if in == nil {
return nil
}
out := new(PVVolumeSnapshotContentPair)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeGroupSnapshot) DeepCopyInto(out *VolumeGroupSnapshot) {
*out = *in
@ -306,8 +270,7 @@ func (in *VolumeGroupSnapshotContentStatus) DeepCopyInto(out *VolumeGroupSnapsho
}
if in.CreationTime != nil {
in, out := &in.CreationTime, &out.CreationTime
*out = new(int64)
**out = **in
*out = (*in).DeepCopy()
}
if in.ReadyToUse != nil {
in, out := &in.ReadyToUse, &out.ReadyToUse
@ -319,9 +282,9 @@ func (in *VolumeGroupSnapshotContentStatus) DeepCopyInto(out *VolumeGroupSnapsho
*out = new(v1.VolumeSnapshotError)
(*in).DeepCopyInto(*out)
}
if in.PVVolumeSnapshotContentList != nil {
in, out := &in.PVVolumeSnapshotContentList, &out.PVVolumeSnapshotContentList
*out = make([]PVVolumeSnapshotContentPair, len(*in))
if in.VolumeSnapshotHandlePairList != nil {
in, out := &in.VolumeSnapshotHandlePairList, &out.VolumeSnapshotHandlePairList
*out = make([]VolumeSnapshotHandlePair, len(*in))
copy(*out, *in)
}
return
@ -440,11 +403,6 @@ func (in *VolumeGroupSnapshotStatus) DeepCopyInto(out *VolumeGroupSnapshotStatus
*out = new(v1.VolumeSnapshotError)
(*in).DeepCopyInto(*out)
}
if in.PVCVolumeSnapshotRefList != nil {
in, out := &in.PVCVolumeSnapshotRefList, &out.PVCVolumeSnapshotRefList
*out = make([]PVCVolumeSnapshotPair, len(*in))
copy(*out, *in)
}
return
}
@ -457,3 +415,19 @@ func (in *VolumeGroupSnapshotStatus) DeepCopy() *VolumeGroupSnapshotStatus {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeSnapshotHandlePair) DeepCopyInto(out *VolumeSnapshotHandlePair) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotHandlePair.
func (in *VolumeSnapshotHandlePair) DeepCopy() *VolumeSnapshotHandlePair {
if in == nil {
return nil
}
out := new(VolumeSnapshotHandlePair)
in.DeepCopyInto(out)
return out
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package scheme
import (
groupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
groupsnapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
@ -32,7 +32,7 @@ var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
groupsnapshotv1alpha1.AddToScheme,
groupsnapshotv1beta1.AddToScheme,
snapshotv1.AddToScheme,
}

View File

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1beta1

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
type VolumeGroupSnapshotExpansion interface{}

View File

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
import (
"context"
"time"
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
scheme "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,15 +38,15 @@ type VolumeGroupSnapshotsGetter interface {
// VolumeGroupSnapshotInterface has methods to work with VolumeGroupSnapshot resources.
type VolumeGroupSnapshotInterface interface {
Create(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.CreateOptions) (*v1alpha1.VolumeGroupSnapshot, error)
Update(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.UpdateOptions) (*v1alpha1.VolumeGroupSnapshot, error)
UpdateStatus(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.UpdateOptions) (*v1alpha1.VolumeGroupSnapshot, error)
Create(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.CreateOptions) (*v1beta1.VolumeGroupSnapshot, error)
Update(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshot, error)
UpdateStatus(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshot, 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) (*v1alpha1.VolumeGroupSnapshot, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeGroupSnapshotList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeGroupSnapshot, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeGroupSnapshotList, 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 *v1alpha1.VolumeGroupSnapshot, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshot, err error)
VolumeGroupSnapshotExpansion
}
@ -57,7 +57,7 @@ type volumeGroupSnapshots struct {
}
// newVolumeGroupSnapshots returns a VolumeGroupSnapshots
func newVolumeGroupSnapshots(c *GroupsnapshotV1alpha1Client, namespace string) *volumeGroupSnapshots {
func newVolumeGroupSnapshots(c *GroupsnapshotV1beta1Client, namespace string) *volumeGroupSnapshots {
return &volumeGroupSnapshots{
client: c.RESTClient(),
ns: namespace,
@ -65,8 +65,8 @@ func newVolumeGroupSnapshots(c *GroupsnapshotV1alpha1Client, namespace string) *
}
// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any.
func (c *volumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
result = &v1alpha1.VolumeGroupSnapshot{}
func (c *volumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshot, err error) {
result = &v1beta1.VolumeGroupSnapshot{}
err = c.client.Get().
Namespace(c.ns).
Resource("volumegroupsnapshots").
@ -78,12 +78,12 @@ func (c *volumeGroupSnapshots) Get(ctx context.Context, name string, options v1.
}
// List takes label and field selectors, and returns the list of VolumeGroupSnapshots that match those selectors.
func (c *volumeGroupSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeGroupSnapshotList, err error) {
func (c *volumeGroupSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.VolumeGroupSnapshotList{}
result = &v1beta1.VolumeGroupSnapshotList{}
err = c.client.Get().
Namespace(c.ns).
Resource("volumegroupsnapshots").
@ -110,8 +110,8 @@ func (c *volumeGroupSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (
}
// Create takes the representation of a volumeGroupSnapshot and creates it. Returns the server's representation of the volumeGroupSnapshot, and an error, if there is any.
func (c *volumeGroupSnapshots) Create(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.CreateOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
result = &v1alpha1.VolumeGroupSnapshot{}
func (c *volumeGroupSnapshots) Create(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshot, err error) {
result = &v1beta1.VolumeGroupSnapshot{}
err = c.client.Post().
Namespace(c.ns).
Resource("volumegroupsnapshots").
@ -123,8 +123,8 @@ func (c *volumeGroupSnapshots) Create(ctx context.Context, volumeGroupSnapshot *
}
// Update takes the representation of a volumeGroupSnapshot and updates it. Returns the server's representation of the volumeGroupSnapshot, and an error, if there is any.
func (c *volumeGroupSnapshots) Update(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.UpdateOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
result = &v1alpha1.VolumeGroupSnapshot{}
func (c *volumeGroupSnapshots) Update(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshot, err error) {
result = &v1beta1.VolumeGroupSnapshot{}
err = c.client.Put().
Namespace(c.ns).
Resource("volumegroupsnapshots").
@ -138,8 +138,8 @@ func (c *volumeGroupSnapshots) Update(ctx context.Context, volumeGroupSnapshot *
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *volumeGroupSnapshots) UpdateStatus(ctx context.Context, volumeGroupSnapshot *v1alpha1.VolumeGroupSnapshot, opts v1.UpdateOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
result = &v1alpha1.VolumeGroupSnapshot{}
func (c *volumeGroupSnapshots) UpdateStatus(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshot, err error) {
result = &v1beta1.VolumeGroupSnapshot{}
err = c.client.Put().
Namespace(c.ns).
Resource("volumegroupsnapshots").
@ -180,8 +180,8 @@ func (c *volumeGroupSnapshots) DeleteCollection(ctx context.Context, opts v1.Del
}
// Patch applies the patch and returns the patched volumeGroupSnapshot.
func (c *volumeGroupSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeGroupSnapshot, err error) {
result = &v1alpha1.VolumeGroupSnapshot{}
func (c *volumeGroupSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshot, err error) {
result = &v1beta1.VolumeGroupSnapshot{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("volumegroupsnapshots").

View File

@ -16,44 +16,44 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
import (
"net/http"
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
"github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type GroupsnapshotV1alpha1Interface interface {
type GroupsnapshotV1beta1Interface interface {
RESTClient() rest.Interface
VolumeGroupSnapshotsGetter
VolumeGroupSnapshotClassesGetter
VolumeGroupSnapshotContentsGetter
}
// GroupsnapshotV1alpha1Client is used to interact with features provided by the groupsnapshot.storage.k8s.io group.
type GroupsnapshotV1alpha1Client struct {
// GroupsnapshotV1beta1Client is used to interact with features provided by the groupsnapshot.storage.k8s.io group.
type GroupsnapshotV1beta1Client struct {
restClient rest.Interface
}
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshots(namespace string) VolumeGroupSnapshotInterface {
func (c *GroupsnapshotV1beta1Client) VolumeGroupSnapshots(namespace string) VolumeGroupSnapshotInterface {
return newVolumeGroupSnapshots(c, namespace)
}
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshotClasses() VolumeGroupSnapshotClassInterface {
func (c *GroupsnapshotV1beta1Client) VolumeGroupSnapshotClasses() VolumeGroupSnapshotClassInterface {
return newVolumeGroupSnapshotClasses(c)
}
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshotContents() VolumeGroupSnapshotContentInterface {
func (c *GroupsnapshotV1beta1Client) VolumeGroupSnapshotContents() VolumeGroupSnapshotContentInterface {
return newVolumeGroupSnapshotContents(c)
}
// NewForConfig creates a new GroupsnapshotV1alpha1Client for the given config.
// NewForConfig creates a new GroupsnapshotV1beta1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*GroupsnapshotV1alpha1Client, error) {
func NewForConfig(c *rest.Config) (*GroupsnapshotV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -65,9 +65,9 @@ func NewForConfig(c *rest.Config) (*GroupsnapshotV1alpha1Client, error) {
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new GroupsnapshotV1alpha1Client for the given config and http client.
// NewForConfigAndClient creates a new GroupsnapshotV1beta1Client for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GroupsnapshotV1alpha1Client, error) {
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GroupsnapshotV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -76,12 +76,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GroupsnapshotV1alph
if err != nil {
return nil, err
}
return &GroupsnapshotV1alpha1Client{client}, nil
return &GroupsnapshotV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new GroupsnapshotV1alpha1Client for the given config and
// NewForConfigOrDie creates a new GroupsnapshotV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *GroupsnapshotV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *GroupsnapshotV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -89,13 +89,13 @@ func NewForConfigOrDie(c *rest.Config) *GroupsnapshotV1alpha1Client {
return client
}
// New creates a new GroupsnapshotV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *GroupsnapshotV1alpha1Client {
return &GroupsnapshotV1alpha1Client{c}
// New creates a new GroupsnapshotV1beta1Client for the given RESTClient.
func New(c rest.Interface) *GroupsnapshotV1beta1Client {
return &GroupsnapshotV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1beta1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -109,7 +109,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *GroupsnapshotV1alpha1Client) RESTClient() rest.Interface {
func (c *GroupsnapshotV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
import (
"context"
"time"
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
scheme "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,14 +38,14 @@ type VolumeGroupSnapshotClassesGetter interface {
// VolumeGroupSnapshotClassInterface has methods to work with VolumeGroupSnapshotClass resources.
type VolumeGroupSnapshotClassInterface interface {
Create(ctx context.Context, volumeGroupSnapshotClass *v1alpha1.VolumeGroupSnapshotClass, opts v1.CreateOptions) (*v1alpha1.VolumeGroupSnapshotClass, error)
Update(ctx context.Context, volumeGroupSnapshotClass *v1alpha1.VolumeGroupSnapshotClass, opts v1.UpdateOptions) (*v1alpha1.VolumeGroupSnapshotClass, error)
Create(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.CreateOptions) (*v1beta1.VolumeGroupSnapshotClass, error)
Update(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshotClass, 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) (*v1alpha1.VolumeGroupSnapshotClass, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeGroupSnapshotClassList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeGroupSnapshotClass, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeGroupSnapshotClassList, 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 *v1alpha1.VolumeGroupSnapshotClass, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotClass, err error)
VolumeGroupSnapshotClassExpansion
}
@ -55,15 +55,15 @@ type volumeGroupSnapshotClasses struct {
}
// newVolumeGroupSnapshotClasses returns a VolumeGroupSnapshotClasses
func newVolumeGroupSnapshotClasses(c *GroupsnapshotV1alpha1Client) *volumeGroupSnapshotClasses {
func newVolumeGroupSnapshotClasses(c *GroupsnapshotV1beta1Client) *volumeGroupSnapshotClasses {
return &volumeGroupSnapshotClasses{
client: c.RESTClient(),
}
}
// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any.
func (c *volumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
result = &v1alpha1.VolumeGroupSnapshotClass{}
func (c *volumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) {
result = &v1beta1.VolumeGroupSnapshotClass{}
err = c.client.Get().
Resource("volumegroupsnapshotclasses").
Name(name).
@ -74,12 +74,12 @@ func (c *volumeGroupSnapshotClasses) Get(ctx context.Context, name string, optio
}
// List takes label and field selectors, and returns the list of VolumeGroupSnapshotClasses that match those selectors.
func (c *volumeGroupSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeGroupSnapshotClassList, err error) {
func (c *volumeGroupSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.VolumeGroupSnapshotClassList{}
result = &v1beta1.VolumeGroupSnapshotClassList{}
err = c.client.Get().
Resource("volumegroupsnapshotclasses").
VersionedParams(&opts, scheme.ParameterCodec).
@ -104,8 +104,8 @@ func (c *volumeGroupSnapshotClasses) Watch(ctx context.Context, opts v1.ListOpti
}
// Create takes the representation of a volumeGroupSnapshotClass and creates it. Returns the server's representation of the volumeGroupSnapshotClass, and an error, if there is any.
func (c *volumeGroupSnapshotClasses) Create(ctx context.Context, volumeGroupSnapshotClass *v1alpha1.VolumeGroupSnapshotClass, opts v1.CreateOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
result = &v1alpha1.VolumeGroupSnapshotClass{}
func (c *volumeGroupSnapshotClasses) Create(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) {
result = &v1beta1.VolumeGroupSnapshotClass{}
err = c.client.Post().
Resource("volumegroupsnapshotclasses").
VersionedParams(&opts, scheme.ParameterCodec).
@ -116,8 +116,8 @@ func (c *volumeGroupSnapshotClasses) Create(ctx context.Context, volumeGroupSnap
}
// Update takes the representation of a volumeGroupSnapshotClass and updates it. Returns the server's representation of the volumeGroupSnapshotClass, and an error, if there is any.
func (c *volumeGroupSnapshotClasses) Update(ctx context.Context, volumeGroupSnapshotClass *v1alpha1.VolumeGroupSnapshotClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
result = &v1alpha1.VolumeGroupSnapshotClass{}
func (c *volumeGroupSnapshotClasses) Update(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) {
result = &v1beta1.VolumeGroupSnapshotClass{}
err = c.client.Put().
Resource("volumegroupsnapshotclasses").
Name(volumeGroupSnapshotClass.Name).
@ -154,8 +154,8 @@ func (c *volumeGroupSnapshotClasses) DeleteCollection(ctx context.Context, opts
}
// Patch applies the patch and returns the patched volumeGroupSnapshotClass.
func (c *volumeGroupSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
result = &v1alpha1.VolumeGroupSnapshotClass{}
func (c *volumeGroupSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotClass, err error) {
result = &v1beta1.VolumeGroupSnapshotClass{}
err = c.client.Patch(pt).
Resource("volumegroupsnapshotclasses").
Name(name).

View File

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1beta1
import (
"context"
"time"
v1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1"
v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1"
scheme "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,15 +38,15 @@ type VolumeGroupSnapshotContentsGetter interface {
// VolumeGroupSnapshotContentInterface has methods to work with VolumeGroupSnapshotContent resources.
type VolumeGroupSnapshotContentInterface interface {
Create(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.CreateOptions) (*v1alpha1.VolumeGroupSnapshotContent, error)
Update(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (*v1alpha1.VolumeGroupSnapshotContent, error)
UpdateStatus(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (*v1alpha1.VolumeGroupSnapshotContent, error)
Create(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.CreateOptions) (*v1beta1.VolumeGroupSnapshotContent, error)
Update(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshotContent, error)
UpdateStatus(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshotContent, 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) (*v1alpha1.VolumeGroupSnapshotContent, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeGroupSnapshotContentList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeGroupSnapshotContent, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeGroupSnapshotContentList, 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 *v1alpha1.VolumeGroupSnapshotContent, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotContent, err error)
VolumeGroupSnapshotContentExpansion
}
@ -56,15 +56,15 @@ type volumeGroupSnapshotContents struct {
}
// newVolumeGroupSnapshotContents returns a VolumeGroupSnapshotContents
func newVolumeGroupSnapshotContents(c *GroupsnapshotV1alpha1Client) *volumeGroupSnapshotContents {
func newVolumeGroupSnapshotContents(c *GroupsnapshotV1beta1Client) *volumeGroupSnapshotContents {
return &volumeGroupSnapshotContents{
client: c.RESTClient(),
}
}
// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any.
func (c *volumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
result = &v1alpha1.VolumeGroupSnapshotContent{}
func (c *volumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) {
result = &v1beta1.VolumeGroupSnapshotContent{}
err = c.client.Get().
Resource("volumegroupsnapshotcontents").
Name(name).
@ -75,12 +75,12 @@ func (c *volumeGroupSnapshotContents) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of VolumeGroupSnapshotContents that match those selectors.
func (c *volumeGroupSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeGroupSnapshotContentList, err error) {
func (c *volumeGroupSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotContentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.VolumeGroupSnapshotContentList{}
result = &v1beta1.VolumeGroupSnapshotContentList{}
err = c.client.Get().
Resource("volumegroupsnapshotcontents").
VersionedParams(&opts, scheme.ParameterCodec).
@ -105,8 +105,8 @@ func (c *volumeGroupSnapshotContents) Watch(ctx context.Context, opts v1.ListOpt
}
// Create takes the representation of a volumeGroupSnapshotContent and creates it. Returns the server's representation of the volumeGroupSnapshotContent, and an error, if there is any.
func (c *volumeGroupSnapshotContents) Create(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.CreateOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
result = &v1alpha1.VolumeGroupSnapshotContent{}
func (c *volumeGroupSnapshotContents) Create(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) {
result = &v1beta1.VolumeGroupSnapshotContent{}
err = c.client.Post().
Resource("volumegroupsnapshotcontents").
VersionedParams(&opts, scheme.ParameterCodec).
@ -117,8 +117,8 @@ func (c *volumeGroupSnapshotContents) Create(ctx context.Context, volumeGroupSna
}
// Update takes the representation of a volumeGroupSnapshotContent and updates it. Returns the server's representation of the volumeGroupSnapshotContent, and an error, if there is any.
func (c *volumeGroupSnapshotContents) Update(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
result = &v1alpha1.VolumeGroupSnapshotContent{}
func (c *volumeGroupSnapshotContents) Update(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) {
result = &v1beta1.VolumeGroupSnapshotContent{}
err = c.client.Put().
Resource("volumegroupsnapshotcontents").
Name(volumeGroupSnapshotContent.Name).
@ -131,8 +131,8 @@ func (c *volumeGroupSnapshotContents) Update(ctx context.Context, volumeGroupSna
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *volumeGroupSnapshotContents) UpdateStatus(ctx context.Context, volumeGroupSnapshotContent *v1alpha1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
result = &v1alpha1.VolumeGroupSnapshotContent{}
func (c *volumeGroupSnapshotContents) UpdateStatus(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) {
result = &v1beta1.VolumeGroupSnapshotContent{}
err = c.client.Put().
Resource("volumegroupsnapshotcontents").
Name(volumeGroupSnapshotContent.Name).
@ -170,8 +170,8 @@ func (c *volumeGroupSnapshotContents) DeleteCollection(ctx context.Context, opts
}
// Patch applies the patch and returns the patched volumeGroupSnapshotContent.
func (c *volumeGroupSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
result = &v1alpha1.VolumeGroupSnapshotContent{}
func (c *volumeGroupSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotContent, err error) {
result = &v1beta1.VolumeGroupSnapshotContent{}
err = c.client.Patch(pt).
Resource("volumegroupsnapshotcontents").
Name(name).

6
vendor/modules.txt vendored
View File

@ -470,12 +470,12 @@ github.com/kubernetes-csi/csi-lib-utils/connection
github.com/kubernetes-csi/csi-lib-utils/metrics
github.com/kubernetes-csi/csi-lib-utils/protosanitizer
github.com/kubernetes-csi/csi-lib-utils/rpc
# github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
# github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0
## explicit; go 1.22.0
github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1
github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1
github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1
github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme
github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1
github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1
github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1
# github.com/kylelemons/godebug v1.1.0
## explicit; go 1.11