From a2c38696e6f63a1438b180ede5d83679930517a5 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 25 Nov 2024 11:07:54 +0100 Subject: [PATCH] e2e: test vgs beta api testing vgs beta api Signed-off-by: Madhu Rajanna --- .../csi-cephfsplugin-provisioner.yaml | 12 +- .../kubernetes/csi-rbdplugin-provisioner.yaml | 12 +- e2e/cephfs.go | 34 +++-- e2e/e2e_test.go | 2 +- e2e/volumegroupsnapshot.go | 35 ++++- e2e/volumegroupsnapshot_base.go | 41 +++-- scripts/install-snapshot.sh | 21 +-- .../{v1alpha1 => v1beta1}/doc.go | 2 +- .../{v1alpha1 => v1beta1}/register.go | 4 +- .../{v1alpha1 => v1beta1}/types.go | 47 ++---- .../zz_generated.deepcopy.go | 65 +++----- .../v8/clientset/versioned/clientset.go | 133 +++++++++++++++++ .../versioned/fake/clientset_generated.go | 92 ++++++++++++ .../client/v8/clientset/versioned/fake/doc.go | 20 +++ .../v8/clientset/versioned/fake/register.go | 58 +++++++ .../v8/clientset/versioned/scheme/register.go | 4 +- .../{v1alpha1 => v1beta1}/doc.go | 2 +- .../volumegroupsnapshot/v1beta1/fake/doc.go | 20 +++ .../v1beta1/fake/fake_volumegroupsnapshot.go | 141 ++++++++++++++++++ .../fake/fake_volumegroupsnapshot_client.go | 48 ++++++ .../fake/fake_volumegroupsnapshotclass.go | 121 +++++++++++++++ .../fake/fake_volumegroupsnapshotcontent.go | 132 ++++++++++++++++ .../generated_expansion.go | 2 +- .../volumegroupsnapshot.go | 42 +++--- .../volumegroupsnapshot_client.go | 40 ++--- .../volumegroupsnapshotclass.go | 36 ++--- .../volumegroupsnapshotcontent.go | 42 +++--- .../typed/volumesnapshot/v1/fake/doc.go | 20 +++ .../v1/fake/fake_volumesnapshot.go | 141 ++++++++++++++++++ .../v1/fake/fake_volumesnapshot_client.go | 48 ++++++ .../v1/fake/fake_volumesnapshotclass.go | 121 +++++++++++++++ .../v1/fake/fake_volumesnapshotcontent.go | 132 ++++++++++++++++ 32 files changed, 1445 insertions(+), 225 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 (92%) rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/{v1alpha1 => v1beta1}/zz_generated.deepcopy.go (90%) create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/clientset.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/clientset_generated.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/doc.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/register.go rename vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/{v1alpha1 => v1beta1}/doc.go (97%) create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/doc.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot_client.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotclass.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotcontent.go 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%) create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/doc.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot_client.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotclass.go create mode 100644 vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotcontent.go diff --git a/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml b/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml index 9443b3ea4fd..3babc227a30 100644 --- a/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml +++ b/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml @@ -145,14 +145,14 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: quay.io/madhupr001/csi-snapshotter:latest 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 @@ -195,9 +195,7 @@ spec: imagePullPolicy: "IfNotPresent" volumes: - name: socket-dir - emptyDir: { - medium: "Memory" - } + emptyDir: { medium: "Memory" } - name: host-sys hostPath: path: /sys @@ -214,9 +212,7 @@ spec: configMap: name: ceph-csi-config - name: keys-tmp-dir - emptyDir: { - medium: "Memory" - } + emptyDir: { medium: "Memory" } - name: ceph-csi-encryption-kms-config configMap: name: ceph-csi-encryption-kms-config diff --git a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml index 2ac2b92179b..5ee9871aa14 100644 --- a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml +++ b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml @@ -134,14 +134,14 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: quay.io/madhupr001/csi-snapshotter:latest 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 @@ -265,9 +265,7 @@ spec: hostPath: path: /lib/modules - name: socket-dir - emptyDir: { - medium: "Memory" - } + emptyDir: { medium: "Memory" } - name: ceph-config configMap: name: ceph-config @@ -278,9 +276,7 @@ spec: configMap: name: ceph-csi-encryption-kms-config - name: keys-tmp-dir - emptyDir: { - medium: "Memory" - } + emptyDir: { medium: "Memory" } - name: oidc-token projected: sources: diff --git a/e2e/cephfs.go b/e2e/cephfs.go index a239b600aae..93cf66dc12b 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -349,6 +349,27 @@ var _ = Describe(cephfsType, func() { } }) + By("test volumeGroupSnapshot", func() { + err := createCephfsStorageClass(f.ClientSet, f, true, nil) + if err != nil { + framework.Failf("failed to create CephFS storageclass: %v", err) + } + scName := "csi-cephfs-sc" + snapshotter, err := newCephFSVolumeGroupSnapshot(f, f.UniqueName, scName, false, deployTimeout, 3) + if err != nil { + framework.Failf("failed to create volumeGroupSnapshot Base: %v", err) + } + + err = snapshotter.TestVolumeGroupSnapshot() + if err != nil { + framework.Failf("failed to test volumeGroupSnapshot: %v", err) + } + err = deleteResource(cephFSExamplePath + "storageclass.yaml") + if err != nil { + framework.Failf("failed to delete CephFS storageclass: %v", err) + } + }) + By("validate fuseMountOptions", func() { params := map[string]string{ "mounter": "fuse", @@ -2478,19 +2499,6 @@ var _ = Describe(cephfsType, func() { } }) - By("test volumeGroupSnapshot", func() { - scName := "csi-cephfs-sc" - snapshotter, err := newCephFSVolumeGroupSnapshot(f, f.UniqueName, scName, false, deployTimeout, 3) - if err != nil { - framework.Failf("failed to create volumeGroupSnapshot Base: %v", err) - } - - err = snapshotter.TestVolumeGroupSnapshot() - if err != nil { - framework.Failf("failed to test volumeGroupSnapshot: %v", err) - } - }) - By("verify rados objects are within a namespace", func() { updateRadosNamespace := func(radosNamespaceName string) { framework.Logf("updating configmap with rados namespace %s", radosNamespace) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index e4538788aeb..873412e4ee8 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -39,7 +39,7 @@ func init() { flag.BoolVar(&deployNFS, "deploy-nfs", false, "deploy nfs csi driver") flag.BoolVar(&testCephFS, "test-cephfs", true, "test cephFS csi driver") flag.BoolVar(&testCephFSFscrypt, "test-cephfs-fscrypt", false, "test CephFS csi driver fscrypt support") - flag.BoolVar(&testRBD, "test-rbd", true, "test rbd csi driver") + flag.BoolVar(&testRBD, "test-rbd", false, "test rbd csi driver") flag.BoolVar(&testRBDFSCrypt, "test-rbd-fscrypt", false, "test rbd csi driver fscrypt support") flag.BoolVar(&testNBD, "test-nbd", false, "test rbd csi driver with rbd-nbd mounter") flag.BoolVar(&testNFS, "test-nfs", false, "test nfs csi driver") diff --git a/e2e/volumegroupsnapshot.go b/e2e/volumegroupsnapshot.go index 8a41aef57ef..7a696e6e8b8 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,17 +79,29 @@ 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, - metav1.GetOptions{}) + pvcName, metav1.GetOptions{}) if err != nil { return fmt.Errorf("failed to get PVC: %w", err) } @@ -165,8 +178,14 @@ 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..295bb934f08 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,14 +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, - metav1.GetOptions{}) + pvcName, metav1.GetOptions{}) if err != nil { return nil, fmt.Errorf("failed to get PVC: %w", err) } @@ -179,12 +201,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 diff --git a/scripts/install-snapshot.sh b/scripts/install-snapshot.sh index 2f0b12b5dcc..42d1f5d1439 100755 --- a/scripts/install-snapshot.sh +++ b/scripts/install-snapshot.sh @@ -25,9 +25,9 @@ VOLUME_SNAPSHOT_CONTENT="${SNAPSHOTTER_URL}/client/config/crd/snapshot.storage.k VOLUME_SNAPSHOT="${SNAPSHOTTER_URL}/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml" # volumegroupsnapshot CRD -VOLUME_GROUP_SNAPSHOTCLASS="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml" -VOLUME_GROUP_SNAPSHOT_CONTENT="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml" -VOLUME_GROUP_SNAPSHOT="${SNAPSHOTTER_URL}/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml" +VOLUME_GROUP_SNAPSHOTCLASS=https://github.com/kubernetes-csi/external-snapshotter/blob/a4754736ebb2dc7475b28d1e4bf7a68e330070fe/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml +VOLUME_GROUP_SNAPSHOT_CONTENT=https://github.com/kubernetes-csi/external-snapshotter/blob/a4754736ebb2dc7475b28d1e4bf7a68e330070fe/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml +VOLUME_GROUP_SNAPSHOT=https://github.com/kubernetes-csi/external-snapshotter/blob/a4754736ebb2dc7475b28d1e4bf7a68e330070fe/client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml function install_snapshot_controller() { local namespace=$1 @@ -74,21 +74,14 @@ function create_or_delete_resource() { curl -o "${temp_snap_controller}" "${SNAPSHOT_CONTROLLER}" sed -i "s/namespace: kube-system/namespace: ${namespace}/g" "${temp_rbac}" sed -i "s/namespace: kube-system/namespace: ${namespace}/g" "${temp_snap_controller}" - sed -i -E "s/(image: registry\.k8s\.io\/sig-storage\/snapshot-controller:).*$/\1$SNAPSHOT_VERSION/g" "${temp_snap_controller}" + sed -i 's|image:.*|image: quay.io/madhupr001/csi-snapshotter:latest|' "${temp_snap_controller}" 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}" - # 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 - echo "Argument already present and matching." - else - # Add the argument if it's not present - sed -i -E "/^(\s+)args:/a\ \ - $ARGUMENT" "${temp_snap_controller}" - fi + # Add the argument if it's not present + sed -i -E "/^(\s+)args:/a\ \ - $ARGUMENT" "${temp_snap_controller}" fi kubectl_retry "${operation}" -f "${VOLUME_GROUP_SNAPSHOTCLASS}" 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 92% 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..a4b0c4dc5e9 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" @@ -108,21 +108,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 +266,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 @@ -354,21 +338,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 +384,14 @@ 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 + 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 + 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..f6113d96514 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 @@ -319,9 +283,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 +404,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 +416,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/clientset.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/clientset.go new file mode 100644 index 00000000000..050de3b875b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/clientset.go @@ -0,0 +1,133 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + groupsnapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1" + snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + GroupsnapshotV1beta1() groupsnapshotv1beta1.GroupsnapshotV1beta1Interface + SnapshotV1() snapshotv1.SnapshotV1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + groupsnapshotV1beta1 *groupsnapshotv1beta1.GroupsnapshotV1beta1Client + snapshotV1 *snapshotv1.SnapshotV1Client +} + +// GroupsnapshotV1beta1 retrieves the GroupsnapshotV1beta1Client +func (c *Clientset) GroupsnapshotV1beta1() groupsnapshotv1beta1.GroupsnapshotV1beta1Interface { + return c.groupsnapshotV1beta1 +} + +// SnapshotV1 retrieves the SnapshotV1Client +func (c *Clientset) SnapshotV1() snapshotv1.SnapshotV1Interface { + return c.snapshotV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.groupsnapshotV1beta1, err = groupsnapshotv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.snapshotV1, err = snapshotv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.groupsnapshotV1beta1 = groupsnapshotv1beta1.New(c) + cs.snapshotV1 = snapshotv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000000..637c89f34ba --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,92 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned" + groupsnapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1" + fakegroupsnapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake" + snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1" + fakesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// GroupsnapshotV1beta1 retrieves the GroupsnapshotV1beta1Client +func (c *Clientset) GroupsnapshotV1beta1() groupsnapshotv1beta1.GroupsnapshotV1beta1Interface { + return &fakegroupsnapshotv1beta1.FakeGroupsnapshotV1beta1{Fake: &c.Fake} +} + +// SnapshotV1 retrieves the SnapshotV1Client +func (c *Clientset) SnapshotV1() snapshotv1.SnapshotV1Interface { + return &fakesnapshotv1.FakeSnapshotV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/doc.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/doc.go new file mode 100644 index 00000000000..c8342d4bda9 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/register.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/register.go new file mode 100644 index 00000000000..c1e1e26d0b2 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/fake/register.go @@ -0,0 +1,58 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + groupsnapshotv1beta1.AddToScheme, + snapshotv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} 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/v1beta1/fake/doc.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/doc.go new file mode 100644 index 00000000000..d9bd9db276b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot.go new file mode 100644 index 00000000000..9cb98c4aeb3 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot.go @@ -0,0 +1,141 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeGroupSnapshots implements VolumeGroupSnapshotInterface +type FakeVolumeGroupSnapshots struct { + Fake *FakeGroupsnapshotV1beta1 + ns string +} + +var volumegroupsnapshotsResource = v1beta1.SchemeGroupVersion.WithResource("volumegroupsnapshots") + +var volumegroupsnapshotsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeGroupSnapshot") + +// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any. +func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumegroupsnapshotsResource, c.ns, name), &v1beta1.VolumeGroupSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshot), err +} + +// List takes label and field selectors, and returns the list of VolumeGroupSnapshots that match those selectors. +func (c *FakeVolumeGroupSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumegroupsnapshotsResource, volumegroupsnapshotsKind, c.ns, opts), &v1beta1.VolumeGroupSnapshotList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeGroupSnapshotList{ListMeta: obj.(*v1beta1.VolumeGroupSnapshotList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeGroupSnapshotList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeGroupSnapshots. +func (c *FakeVolumeGroupSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumegroupsnapshotsResource, c.ns, opts)) + +} + +// 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 *FakeVolumeGroupSnapshots) Create(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumegroupsnapshotsResource, c.ns, volumeGroupSnapshot), &v1beta1.VolumeGroupSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshot), err +} + +// 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 *FakeVolumeGroupSnapshots) Update(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumegroupsnapshotsResource, c.ns, volumeGroupSnapshot), &v1beta1.VolumeGroupSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshot), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeGroupSnapshots) UpdateStatus(ctx context.Context, volumeGroupSnapshot *v1beta1.VolumeGroupSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshot, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumegroupsnapshotsResource, "status", c.ns, volumeGroupSnapshot), &v1beta1.VolumeGroupSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshot), err +} + +// Delete takes name of the volumeGroupSnapshot and deletes it. Returns an error if one occurs. +func (c *FakeVolumeGroupSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(volumegroupsnapshotsResource, c.ns, name, opts), &v1beta1.VolumeGroupSnapshot{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeGroupSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumegroupsnapshotsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeGroupSnapshotList{}) + return err +} + +// Patch applies the patch and returns the patched volumeGroupSnapshot. +func (c *FakeVolumeGroupSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumegroupsnapshotsResource, c.ns, name, pt, data, subresources...), &v1beta1.VolumeGroupSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshot), err +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot_client.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot_client.go new file mode 100644 index 00000000000..47ce2cb4fbc --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshot_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeGroupsnapshotV1beta1 struct { + *testing.Fake +} + +func (c *FakeGroupsnapshotV1beta1) VolumeGroupSnapshots(namespace string) v1beta1.VolumeGroupSnapshotInterface { + return &FakeVolumeGroupSnapshots{c, namespace} +} + +func (c *FakeGroupsnapshotV1beta1) VolumeGroupSnapshotClasses() v1beta1.VolumeGroupSnapshotClassInterface { + return &FakeVolumeGroupSnapshotClasses{c} +} + +func (c *FakeGroupsnapshotV1beta1) VolumeGroupSnapshotContents() v1beta1.VolumeGroupSnapshotContentInterface { + return &FakeVolumeGroupSnapshotContents{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeGroupsnapshotV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotclass.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotclass.go new file mode 100644 index 00000000000..1ca15d7e06b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotclass.go @@ -0,0 +1,121 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeGroupSnapshotClasses implements VolumeGroupSnapshotClassInterface +type FakeVolumeGroupSnapshotClasses struct { + Fake *FakeGroupsnapshotV1beta1 +} + +var volumegroupsnapshotclassesResource = v1beta1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses") + +var volumegroupsnapshotclassesKind = v1beta1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotClass") + +// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any. +func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumegroupsnapshotclassesResource, name), &v1beta1.VolumeGroupSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotClass), err +} + +// List takes label and field selectors, and returns the list of VolumeGroupSnapshotClasses that match those selectors. +func (c *FakeVolumeGroupSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotClassList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumegroupsnapshotclassesResource, volumegroupsnapshotclassesKind, opts), &v1beta1.VolumeGroupSnapshotClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeGroupSnapshotClassList{ListMeta: obj.(*v1beta1.VolumeGroupSnapshotClassList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeGroupSnapshotClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeGroupSnapshotClasses. +func (c *FakeVolumeGroupSnapshotClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumegroupsnapshotclassesResource, opts)) +} + +// 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 *FakeVolumeGroupSnapshotClasses) Create(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumegroupsnapshotclassesResource, volumeGroupSnapshotClass), &v1beta1.VolumeGroupSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotClass), err +} + +// 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 *FakeVolumeGroupSnapshotClasses) Update(ctx context.Context, volumeGroupSnapshotClass *v1beta1.VolumeGroupSnapshotClass, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumegroupsnapshotclassesResource, volumeGroupSnapshotClass), &v1beta1.VolumeGroupSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotClass), err +} + +// Delete takes name of the volumeGroupSnapshotClass and deletes it. Returns an error if one occurs. +func (c *FakeVolumeGroupSnapshotClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumegroupsnapshotclassesResource, name, opts), &v1beta1.VolumeGroupSnapshotClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeGroupSnapshotClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumegroupsnapshotclassesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeGroupSnapshotClassList{}) + return err +} + +// Patch applies the patch and returns the patched volumeGroupSnapshotClass. +func (c *FakeVolumeGroupSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumegroupsnapshotclassesResource, name, pt, data, subresources...), &v1beta1.VolumeGroupSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotClass), err +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotcontent.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotcontent.go new file mode 100644 index 00000000000..738f0cd4b19 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumegroupsnapshot/v1beta1/fake/fake_volumegroupsnapshotcontent.go @@ -0,0 +1,132 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumegroupsnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeGroupSnapshotContents implements VolumeGroupSnapshotContentInterface +type FakeVolumeGroupSnapshotContents struct { + Fake *FakeGroupsnapshotV1beta1 +} + +var volumegroupsnapshotcontentsResource = v1beta1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents") + +var volumegroupsnapshotcontentsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeGroupSnapshotContent") + +// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any. +func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumegroupsnapshotcontentsResource, name), &v1beta1.VolumeGroupSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotContent), err +} + +// List takes label and field selectors, and returns the list of VolumeGroupSnapshotContents that match those selectors. +func (c *FakeVolumeGroupSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeGroupSnapshotContentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumegroupsnapshotcontentsResource, volumegroupsnapshotcontentsKind, opts), &v1beta1.VolumeGroupSnapshotContentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeGroupSnapshotContentList{ListMeta: obj.(*v1beta1.VolumeGroupSnapshotContentList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeGroupSnapshotContentList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeGroupSnapshotContents. +func (c *FakeVolumeGroupSnapshotContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumegroupsnapshotcontentsResource, opts)) +} + +// 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 *FakeVolumeGroupSnapshotContents) Create(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.CreateOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumegroupsnapshotcontentsResource, volumeGroupSnapshotContent), &v1beta1.VolumeGroupSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotContent), err +} + +// 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 *FakeVolumeGroupSnapshotContents) Update(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeGroupSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumegroupsnapshotcontentsResource, volumeGroupSnapshotContent), &v1beta1.VolumeGroupSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotContent), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeGroupSnapshotContents) UpdateStatus(ctx context.Context, volumeGroupSnapshotContent *v1beta1.VolumeGroupSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeGroupSnapshotContent, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(volumegroupsnapshotcontentsResource, "status", volumeGroupSnapshotContent), &v1beta1.VolumeGroupSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotContent), err +} + +// Delete takes name of the volumeGroupSnapshotContent and deletes it. Returns an error if one occurs. +func (c *FakeVolumeGroupSnapshotContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumegroupsnapshotcontentsResource, name, opts), &v1beta1.VolumeGroupSnapshotContent{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeGroupSnapshotContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumegroupsnapshotcontentsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeGroupSnapshotContentList{}) + return err +} + +// Patch applies the patch and returns the patched volumeGroupSnapshotContent. +func (c *FakeVolumeGroupSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeGroupSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumegroupsnapshotcontentsResource, name, pt, data, subresources...), &v1beta1.VolumeGroupSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeGroupSnapshotContent), err +} 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/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/doc.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/doc.go new file mode 100644 index 00000000000..d9bd9db276b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot.go new file mode 100644 index 00000000000..ddf1a01214c --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot.go @@ -0,0 +1,141 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshots implements VolumeSnapshotInterface +type FakeVolumeSnapshots struct { + Fake *FakeSnapshotV1 + ns string +} + +var volumesnapshotsResource = v1.SchemeGroupVersion.WithResource("volumesnapshots") + +var volumesnapshotsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshot") + +// Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. +func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &v1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshot), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors. +func (c *FakeVolumeSnapshots) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &v1.VolumeSnapshotList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.VolumeSnapshotList{ListMeta: obj.(*v1.VolumeSnapshotList).ListMeta} + for _, item := range obj.(*v1.VolumeSnapshotList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshots. +func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts)) + +} + +// Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.CreateOptions) (result *v1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshot), err +} + +// Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (result *v1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshot), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *v1.VolumeSnapshot, opts metav1.UpdateOptions) (*v1.VolumeSnapshot, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &v1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshot), err +} + +// Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &v1.VolumeSnapshot{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshot. +func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &v1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshot), err +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot_client.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot_client.go new file mode 100644 index 00000000000..3877e415864 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshot_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeSnapshotV1 struct { + *testing.Fake +} + +func (c *FakeSnapshotV1) VolumeSnapshots(namespace string) v1.VolumeSnapshotInterface { + return &FakeVolumeSnapshots{c, namespace} +} + +func (c *FakeSnapshotV1) VolumeSnapshotClasses() v1.VolumeSnapshotClassInterface { + return &FakeVolumeSnapshotClasses{c} +} + +func (c *FakeSnapshotV1) VolumeSnapshotContents() v1.VolumeSnapshotContentInterface { + return &FakeVolumeSnapshotContents{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSnapshotV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotclass.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotclass.go new file mode 100644 index 00000000000..5d198af9f53 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotclass.go @@ -0,0 +1,121 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshotClasses implements VolumeSnapshotClassInterface +type FakeVolumeSnapshotClasses struct { + Fake *FakeSnapshotV1 +} + +var volumesnapshotclassesResource = v1.SchemeGroupVersion.WithResource("volumesnapshotclasses") + +var volumesnapshotclassesKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotClass") + +// Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. +func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &v1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotClass), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors. +func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotClassList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &v1.VolumeSnapshotClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.VolumeSnapshotClassList{ListMeta: obj.(*v1.VolumeSnapshotClassList).ListMeta} + for _, item := range obj.(*v1.VolumeSnapshotClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshotClasses. +func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts)) +} + +// Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.CreateOptions) (result *v1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotClass), err +} + +// Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *v1.VolumeSnapshotClass, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotClass), err +} + +// Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &v1.VolumeSnapshotClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotClassList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshotClass. +func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &v1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotClass), err +} diff --git a/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotcontent.go b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotcontent.go new file mode 100644 index 00000000000..229e3387ef8 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned/typed/volumesnapshot/v1/fake/fake_volumesnapshotcontent.go @@ -0,0 +1,132 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshotContents implements VolumeSnapshotContentInterface +type FakeVolumeSnapshotContents struct { + Fake *FakeSnapshotV1 +} + +var volumesnapshotcontentsResource = v1.SchemeGroupVersion.WithResource("volumesnapshotcontents") + +var volumesnapshotcontentsKind = v1.SchemeGroupVersion.WithKind("VolumeSnapshotContent") + +// Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. +func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &v1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotContent), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors. +func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeSnapshotContentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &v1.VolumeSnapshotContentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.VolumeSnapshotContentList{ListMeta: obj.(*v1.VolumeSnapshotContentList).ListMeta} + for _, item := range obj.(*v1.VolumeSnapshotContentList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshotContents. +func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts)) +} + +// Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.CreateOptions) (result *v1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotContent), err +} + +// Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (result *v1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotContent), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *v1.VolumeSnapshotContent, opts metav1.UpdateOptions) (*v1.VolumeSnapshotContent, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &v1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotContent), err +} + +// Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &v1.VolumeSnapshotContent{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1.VolumeSnapshotContentList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshotContent. +func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &v1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1.VolumeSnapshotContent), err +}