From 58327a3ddc035aef6dbe29accfe8b492a55345ed Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:21:56 +0100 Subject: [PATCH 1/7] build: update snapshot version updating the snapshot version in the build.env Signed-off-by: Madhu Rajanna (cherry picked from commit 884c47dd3cebd961eb1e59d7be10ce0d2afdd304) --- build.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.env b/build.env index e2148dc1557..8f9c44d560b 100644 --- a/build.env +++ b/build.env @@ -30,7 +30,7 @@ GOLANGCI_VERSION=v1.57.2 # external snapshotter version # Refer: https://github.com/kubernetes-csi/external-snapshotter/releases -SNAPSHOT_VERSION=v8.0.1 +SNAPSHOT_VERSION=v8.2.0 # "go test" configuration # set to stdout or html to enable coverage reporting, disabled by default @@ -55,7 +55,7 @@ ROOK_CEPH_CLUSTER_IMAGE=quay.io/ceph/ceph:v19 # CSI sidecar version CSI_ATTACHER_VERSION=v4.6.1 -CSI_SNAPSHOTTER_VERSION=v8.0.1 +CSI_SNAPSHOTTER_VERSION=v8.2.0 CSI_RESIZER_VERSION=v1.11.1 CSI_PROVISIONER_VERSION=v5.0.1 CSI_NODE_DRIVER_REGISTRAR_VERSION=v2.11.1 From ec6f77a23b60c2ea3a3060ef48e55d5eb4c0cc58 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:22:59 +0100 Subject: [PATCH 2/7] deploy: update template for vgs flag updating the snapshotter image to 8.2.0 and update the flag to enable vgs feature. Signed-off-by: Madhu Rajanna (cherry picked from commit 23da6d9b13f89452269c6918f68839236661047c) --- deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml | 4 ++-- deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml | 2 +- deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml b/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml index 7a8a670d435..40b52c4d5ab 100644 --- a/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml +++ b/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml @@ -144,14 +144,14 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0 args: - "--csi-address=$(ADDRESS)" - "--v=1" - "--timeout=150s" - "--leader-election=true" - "--extra-create-metadata=true" - - "--enable-volume-group-snapshots=true" + - "--feature-gates=CSIVolumeGroupSnapshot=true" - "--http-endpoint=$(POD_IP):8092" env: - name: ADDRESS diff --git a/deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml b/deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml index 144b88335b3..15a3e65ab25 100644 --- a/deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml +++ b/deploy/nfs/kubernetes/csi-nfsplugin-provisioner.yaml @@ -124,7 +124,7 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0 args: - "--csi-address=$(ADDRESS)" - "--v=1" diff --git a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml index bb28813eaf4..cce94def735 100644 --- a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml +++ b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml @@ -133,14 +133,14 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0 args: - "--csi-address=$(ADDRESS)" - "--v=1" - "--timeout=150s" - "--leader-election=true" - "--extra-create-metadata=true" - - "--enable-volume-group-snapshots=true" + - "--feature-gates=CSIVolumeGroupSnapshot=true" - "--http-endpoint=$(POD_IP):8092" env: - name: ADDRESS From 8e3678bbc1192b891fca348d73d8ffc9e073355d Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:24:42 +0100 Subject: [PATCH 3/7] helm: update template for vgs flag updating the snapshotter image to 8.2.0 and update the flag to enable vgs feature. Signed-off-by: Madhu Rajanna (cherry picked from commit 5bfff89e04f0d45d6b090bf35a7688aa771ddc1d) --- charts/ceph-csi-cephfs/README.md | 2 +- charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml | 2 +- charts/ceph-csi-cephfs/values.yaml | 2 +- charts/ceph-csi-rbd/README.md | 2 +- charts/ceph-csi-rbd/templates/provisioner-deployment.yaml | 2 +- charts/ceph-csi-rbd/values.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/ceph-csi-cephfs/README.md b/charts/ceph-csi-cephfs/README.md index 6c010db214c..1ef049270d9 100644 --- a/charts/ceph-csi-cephfs/README.md +++ b/charts/ceph-csi-cephfs/README.md @@ -189,7 +189,7 @@ charts and their default values. | `provisioner.resizer.args.httpEndpointPort` | Specifies http server port for diagnostics, health checks and metrics | `""` | | `provisioner.resizer.extraArgs` | Specifies extra arguments for the resizer sidecar | `[]` | | `provisioner.snapshotter.image.repository` | Specifies the csi-snapshotter image repository URL | `registry.k8s.io/sig-storage/csi-snapshotter` | -| `provisioner.snapshotter.image.tag` | Specifies image tag | `v8.0.1` | +| `provisioner.snapshotter.image.tag` | Specifies image tag | `v8.2.0` | | `provisioner.snapshotter.image.pullPolicy` | Specifies pull policy | `IfNotPresent` | | `provisioner.snapshotter.args.enableVolumeGroupSnapshots` | enables the creation of volume group snapshots | `false` | | `provisioner.snapshotter.args.httpEndpointPort` | Specifies http server port for diagnostics, health checks and metrics | `""` | diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml index e68dd03e251..84d9dcbe7d9 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml @@ -177,7 +177,7 @@ spec: - "--timeout={{ .Values.provisioner.timeout }}" - "--leader-election=true" - "--extra-create-metadata=true" - - "--enable-volume-group-snapshots={{.Values.provisioner.snapshotter.args.enableVolumeGroupSnapshots }}" + - "--feature-gates=CSIVolumeGroupSnapshot={{.Values.provisioner.snapshotter.args.enableVolumeGroupSnapshots }}" {{- if and .Values.provisioner.snapshotter.args .Values.provisioner.snapshotter.args.httpEndpointPort }} - "--http-endpoint=$(POD_IP):{{ .Values.provisioner.snapshotter.args.httpEndpointPort }}" {{- end }} diff --git a/charts/ceph-csi-cephfs/values.yaml b/charts/ceph-csi-cephfs/values.yaml index 9267e9e607c..e47ae5a1e40 100644 --- a/charts/ceph-csi-cephfs/values.yaml +++ b/charts/ceph-csi-cephfs/values.yaml @@ -264,7 +264,7 @@ provisioner: snapshotter: image: repository: registry.k8s.io/sig-storage/csi-snapshotter - tag: v8.0.1 + tag: v8.2.0 pullPolicy: IfNotPresent resources: {} args: diff --git a/charts/ceph-csi-rbd/README.md b/charts/ceph-csi-rbd/README.md index b1156e57993..aab6123ace9 100644 --- a/charts/ceph-csi-rbd/README.md +++ b/charts/ceph-csi-rbd/README.md @@ -176,7 +176,7 @@ charts and their default values. | `provisioner.resizer.args.httpEndpointPort` | Specifies http server port for diagnostics, health checks and metrics | `""` | | `provisioner.resizer.extraArgs` | Specifies extra arguments for the resizer sidecar | `[]` | | `provisioner.snapshotter.image.repository` | Specifies the csi-snapshotter image repository URL | `registry.k8s.io/sig-storage/csi-snapshotter` | -| `provisioner.snapshotter.image.tag` | Specifies image tag | `v8.0.1` | +| `provisioner.snapshotter.image.tag` | Specifies image tag | `v8.2.0` | | `provisioner.snapshotter.image.pullPolicy` | Specifies pull policy | `IfNotPresent` | | `provisioner.snapshotter.args.enableVolumeGroupSnapshots` | enables the creation of volume group snapshots | `false` | | `provisioner.snapshotter.args.httpEndpointPort` | Specifies http server port for diagnostics, health checks and metrics | `""` | diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml index a3fec164c7e..9849ff1ce08 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml @@ -228,7 +228,7 @@ spec: - "--timeout={{ .Values.provisioner.timeout }}" - "--leader-election=true" - "--extra-create-metadata=true" - - "--enable-volume-group-snapshots={{.Values.provisioner.snapshotter.args.enableVolumeGroupSnapshots }}" + - "--feature-gates=CSIVolumeGroupSnapshot={{.Values.provisioner.snapshotter.args.enableVolumeGroupSnapshots }}" {{- if and .Values.provisioner.snapshotter.args .Values.provisioner.snapshotter.args.httpEndpointPort }} - "--http-endpoint=$(POD_IP):{{ .Values.provisioner.snapshotter.args.httpEndpointPort }}" {{- end }} diff --git a/charts/ceph-csi-rbd/values.yaml b/charts/ceph-csi-rbd/values.yaml index f7f97b89b23..f9f6160d899 100644 --- a/charts/ceph-csi-rbd/values.yaml +++ b/charts/ceph-csi-rbd/values.yaml @@ -302,7 +302,7 @@ provisioner: snapshotter: image: repository: registry.k8s.io/sig-storage/csi-snapshotter - tag: v8.0.1 + tag: v8.2.0 pullPolicy: IfNotPresent resources: {} args: From 9960be6a5a9e9790fac9048813094617b98d1fe7 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:31:29 +0100 Subject: [PATCH 4/7] e2e: update snapshot to v1beta1 updating the snapshot client and test to use v1beta1 client and API. Signed-off-by: Madhu Rajanna (cherry picked from commit a17fef07e6058764050f569b05baf0d6fab359e6) --- e2e/volumegroupsnapshot.go | 39 +++++++++-- e2e/volumegroupsnapshot_base.go | 48 +++++++++---- go.mod | 2 +- go.sum | 4 +- .../{v1alpha1 => v1beta1}/doc.go | 2 +- .../{v1alpha1 => v1beta1}/register.go | 4 +- .../{v1alpha1 => v1beta1}/types.go | 53 ++++++--------- .../zz_generated.deepcopy.go | 68 ++++++------------- .../v8/clientset/versioned/scheme/register.go | 4 +- .../{v1alpha1 => v1beta1}/doc.go | 2 +- .../generated_expansion.go | 2 +- .../volumegroupsnapshot.go | 42 ++++++------ .../volumegroupsnapshot_client.go | 40 +++++------ .../volumegroupsnapshotclass.go | 36 +++++----- .../volumegroupsnapshotcontent.go | 42 ++++++------ vendor/modules.txt | 6 +- 16 files changed, 202 insertions(+), 192 deletions(-) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/{v1alpha1 => v1beta1}/doc.go (97%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/{v1alpha1 => v1beta1}/register.go (98%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/{v1alpha1 => v1beta1}/types.go (91%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (90%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/doc.go (97%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/generated_expansion.go (97%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/volumegroupsnapshot.go (77%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/volumegroupsnapshot_client.go (62%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/volumegroupsnapshotclass.go (77%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/volumegroupsnapshotcontent.go (76%) diff --git a/e2e/volumegroupsnapshot.go b/e2e/volumegroupsnapshot.go index 8a41aef57ef..9ec6f70ec16 100644 --- a/e2e/volumegroupsnapshot.go +++ b/e2e/volumegroupsnapshot.go @@ -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) diff --git a/e2e/volumegroupsnapshot_base.go b/e2e/volumegroupsnapshot_base.go index 47bb177386d..45aa6bbc1d6 100644 --- a/e2e/volumegroupsnapshot_base.go +++ b/e2e/volumegroupsnapshot_base.go @@ -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{}) diff --git a/go.mod b/go.mod index 58c1524b795..ecb3f059ee6 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index ef2edd016a5..3737c99241f 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/doc.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/doc.go similarity index 97% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/doc.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/doc.go index f3b8d19ef2f..f2fdf6b8b98 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/doc.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=groupsnapshot.storage.k8s.io -package v1alpha1 +package v1beta1 diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/register.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/register.go similarity index 98% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/register.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/register.go index 42b82aaee74..22cebf9451a 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/register.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/register.go @@ -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 { diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/types.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/types.go similarity index 91% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/types.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/types.go index 445a2ee013a..da0540bcfbf 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/types.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/types.go @@ -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"` +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/zz_generated.deepcopy.go similarity index 90% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/zz_generated.deepcopy.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/zz_generated.deepcopy.go index dd58419d93f..4c59130dfd5 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1/zz_generated.deepcopy.go @@ -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 +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme/register.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme/register.go index 7ecf08084f6..6f8c4fdf002 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme/register.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/scheme/register.go @@ -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, } diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/doc.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/doc.go similarity index 97% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/doc.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/doc.go index ecc54622106..c70a3f53199 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/doc.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/doc.go @@ -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 diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/generated_expansion.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/generated_expansion.go similarity index 97% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/generated_expansion.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/generated_expansion.go index 76c6ee96a6f..10f62712e43 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/generated_expansion.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 type VolumeGroupSnapshotExpansion interface{} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot.go similarity index 77% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot.go index 413d6bcac87..8687a330f81 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot.go @@ -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"). diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot_client.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot_client.go similarity index 62% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot_client.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot_client.go index 14cf7707d41..49ecc7cf5e0 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshot_client.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshot_client.go @@ -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 } diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotclass.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotclass.go similarity index 77% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotclass.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotclass.go index 7abdf2c6b76..642cedd705e 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotclass.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotclass.go @@ -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). diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotcontent.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotcontent.go similarity index 76% rename from vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotcontent.go rename to vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotcontent.go index e27f3d09257..eafada58954 100644 --- a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/volumegroupsnapshotcontent.go +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/volumegroupsnapshotcontent.go @@ -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). diff --git a/vendor/modules.txt b/vendor/modules.txt index 2ad092226cc..cbef5bbe648 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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 From 5a0f8ba15f6369838347e5e48c49a4596350d458 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:32:14 +0100 Subject: [PATCH 5/7] ci: adjust the snapshot to enable vgs updating the snapshot container ARG to enable the vgs feature. Signed-off-by: Madhu Rajanna (cherry picked from commit eb66ec8177699c36323f886c93816ffc528d8e3b) --- scripts/install-snapshot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index 2f0b12b5dcc..acd0257611f 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -78,12 +78,12 @@ function create_or_delete_resource() { if [ "${operation}" == "create" ]; then # Argument to add/update - ARGUMENT="--enable-volume-group-snapshots=true" + ARGUMENT="--feature-gates=CSIVolumeGroupSnapshot=true" # Check if the argument is already present and set to false - if grep -q -E "^\s+-\s+--enable-volume-group-snapshots=false" "${temp_snap_controller}"; then - sed -i -E "s/^\s+-\s+--enable-volume-group-snapshots=false$/ - $ARGUMENT/" "${temp_snap_controller}" + if grep -q -E "^\s+-\s+--feature-gates=CSIVolumeGroupSnapshot=false" "${temp_snap_controller}"; then + sed -i -E "s/^\s+-\s+----feature-gates=CSIVolumeGroupSnapshot=false$/ - $ARGUMENT/" "${temp_snap_controller}" # Check if the argument is already present and set to true - elif grep -q -E "^\s+-\s+--enable-volume-group-snapshots=true" "${temp_snap_controller}"; then + elif grep -q -E "^\s+-\s+--feature-gates=CSIVolumeGroupSnapshot=true" "${temp_snap_controller}"; then echo "Argument already present and matching." else # Add the argument if it's not present From 5c8d5449fa40e7c1e4de1315fa0b0a3815e1d6f2 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 12 Dec 2024 13:50:12 +0100 Subject: [PATCH 6/7] deploy: update the vgs api to v1beta1 updating the yamls of vgs to v1beta1 Signed-off-by: Madhu Rajanna (cherry picked from commit 21d639df2054e8fa75d95a82790b953d21e4888e) --- examples/cephfs/groupsnapshot.yaml | 2 +- examples/cephfs/groupsnapshotclass.yaml | 2 +- examples/rbd/groupsnapshot.yaml | 2 +- examples/rbd/groupsnapshotclass.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/cephfs/groupsnapshot.yaml b/examples/cephfs/groupsnapshot.yaml index 5275685176c..e2d25f85711 100644 --- a/examples/cephfs/groupsnapshot.yaml +++ b/examples/cephfs/groupsnapshot.yaml @@ -1,5 +1,5 @@ --- -apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +apiVersion: groupsnapshot.storage.k8s.io/v1beta1 kind: VolumeGroupSnapshot metadata: name: new-groupsnapshot-demo-1 diff --git a/examples/cephfs/groupsnapshotclass.yaml b/examples/cephfs/groupsnapshotclass.yaml index 7c30ee08800..88958e73d89 100644 --- a/examples/cephfs/groupsnapshotclass.yaml +++ b/examples/cephfs/groupsnapshotclass.yaml @@ -1,5 +1,5 @@ --- -apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +apiVersion: groupsnapshot.storage.k8s.io/v1beta1 kind: VolumeGroupSnapshotClass metadata: name: csi-cephfsplugin-groupsnapclass diff --git a/examples/rbd/groupsnapshot.yaml b/examples/rbd/groupsnapshot.yaml index 4584299d5fb..7d957761ac9 100644 --- a/examples/rbd/groupsnapshot.yaml +++ b/examples/rbd/groupsnapshot.yaml @@ -1,5 +1,5 @@ --- -apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +apiVersion: groupsnapshot.storage.k8s.io/v1beta1 kind: VolumeGroupSnapshot metadata: name: rbd-groupsnapshot diff --git a/examples/rbd/groupsnapshotclass.yaml b/examples/rbd/groupsnapshotclass.yaml index 1f19c6898c8..16f83db8d9a 100644 --- a/examples/rbd/groupsnapshotclass.yaml +++ b/examples/rbd/groupsnapshotclass.yaml @@ -1,5 +1,5 @@ --- -apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +apiVersion: groupsnapshot.storage.k8s.io/v1beta1 kind: VolumeGroupSnapshotClass metadata: name: csi-rbdplugin-groupsnapclass From 12970635e00c1006eb7299ead1f39f2d593facb7 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 16 Dec 2024 10:28:04 +0100 Subject: [PATCH 7/7] e2e: remove vsg flag present in older snapshotter Remove the vsg flag present in the older snapshotter which is meant only for the Alpha Release and we are no longer installing Alpha CRD. Signed-off-by: Madhu Rajanna (cherry picked from commit a88f86e9a43a82aa5132bf5b2839f8aa9303a15e) --- e2e/deployment.go | 3 +++ e2e/utils.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/e2e/deployment.go b/e2e/deployment.go index 12b86acdacc..bce18053874 100644 --- a/e2e/deployment.go +++ b/e2e/deployment.go @@ -252,6 +252,9 @@ func (yrn *yamlResourceNamespaced) Do(action kubectlAction) error { data = replaceLogLevelInTemplate(data) + // disable VGS alpha feature, TODO: remove this in next release (3.14.0) + data = disableVGSAlphaCLIArg(data) + if yrn.oneReplica { data = oneReplicaDeployYaml(data) } diff --git a/e2e/utils.go b/e2e/utils.go index 7e0f94d6128..c02fc9d1c99 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -820,6 +820,10 @@ func checkMountOptions(pvcPath, appPath string, f *framework.Framework, mountFla return err } +func disableVGSAlphaCLIArg(template string) string { + return strings.ReplaceAll(template, "- \"--enable-volume-group-snapshots=true\"", "") +} + func addTopologyDomainsToDSYaml(template, labels string) string { return strings.ReplaceAll(template, "# - \"--domainlabels=failure-domain/region,failure-domain/zone\"", "- \"--domainlabels="+labels+"\"")