Skip to content

Commit b55e1f9

Browse files
authored
Merge pull request #425 from xing-yang/only_controller
Update controller based on snapshot v1 apis
2 parents 09c2251 + 5069c99 commit b55e1f9

21 files changed

+569
-138
lines changed

cmd/csi-snapshotter/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ func main() {
190190
snapClient,
191191
kubeClient,
192192
driverName,
193-
factory.Snapshot().V1beta1().VolumeSnapshotContents(),
194-
factory.Snapshot().V1beta1().VolumeSnapshotClasses(),
193+
factory.Snapshot().V1().VolumeSnapshotContents(),
194+
factory.Snapshot().V1().VolumeSnapshotClasses(),
195195
snapShotter,
196196
*csiTimeout,
197197
*resyncPeriod,

cmd/snapshot-controller/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ func main() {
122122
ctrl := controller.NewCSISnapshotCommonController(
123123
snapClient,
124124
kubeClient,
125-
factory.Snapshot().V1beta1().VolumeSnapshots(),
126-
factory.Snapshot().V1beta1().VolumeSnapshotContents(),
127-
factory.Snapshot().V1beta1().VolumeSnapshotClasses(),
125+
factory.Snapshot().V1().VolumeSnapshots(),
126+
factory.Snapshot().V1().VolumeSnapshotContents(),
127+
factory.Snapshot().V1().VolumeSnapshotClasses(),
128128
coreFactory.Core().V1().PersistentVolumeClaims(),
129129
metricsManager,
130130
*resyncPeriod,

deploy/kubernetes/webhook-example/admission-configuration-template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ webhooks:
66
- name: "validation-webhook.snapshot.storage.k8s.io"
77
rules:
88
- apiGroups: ["snapshot.storage.k8s.io"]
9-
apiVersions: ["v1beta1"]
9+
apiVersions: ["v1", "v1beta1"]
1010
operations: ["CREATE", "UPDATE"]
1111
resources: ["volumesnapshots", "volumesnapshotcontents"]
1212
scope: "*"

pkg/common-controller/framework_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import (
2828
"testing"
2929
"time"
3030

31-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
31+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
3232
clientset "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned"
3333
"github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned/fake"
3434
snapshotscheme "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned/scheme"
3535
informers "github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions"
36-
storagelisters "github.com/kubernetes-csi/external-snapshotter/client/v3/listers/volumesnapshot/v1beta1"
36+
storagelisters "github.com/kubernetes-csi/external-snapshotter/client/v3/listers/volumesnapshot/v1"
3737
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/metrics"
3838
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/utils"
3939
v1 "k8s.io/api/core/v1"
@@ -743,9 +743,9 @@ func newTestController(kubeClient kubernetes.Interface, clientset clientset.Inte
743743
ctrl := NewCSISnapshotCommonController(
744744
clientset,
745745
kubeClient,
746-
informerFactory.Snapshot().V1beta1().VolumeSnapshots(),
747-
informerFactory.Snapshot().V1beta1().VolumeSnapshotContents(),
748-
informerFactory.Snapshot().V1beta1().VolumeSnapshotClasses(),
746+
informerFactory.Snapshot().V1().VolumeSnapshots(),
747+
informerFactory.Snapshot().V1().VolumeSnapshotContents(),
748+
informerFactory.Snapshot().V1().VolumeSnapshotClasses(),
749749
coreFactory.Core().V1().PersistentVolumeClaims(),
750750
metricsManager,
751751
60*time.Second,
@@ -803,7 +803,7 @@ func newContent(contentName, boundToSnapshotUID, boundToSnapshotName, snapshotHa
803803
if boundToSnapshotName != "" {
804804
content.Spec.VolumeSnapshotRef = v1.ObjectReference{
805805
Kind: "VolumeSnapshot",
806-
APIVersion: "snapshot.storage.k8s.io/v1beta1",
806+
APIVersion: "snapshot.storage.k8s.io/v1",
807807
UID: types.UID(boundToSnapshotUID),
808808
Namespace: testNamespace,
809809
Name: boundToSnapshotName,
@@ -907,7 +907,7 @@ func newSnapshot(
907907
Namespace: testNamespace,
908908
UID: types.UID(snapshotUID),
909909
ResourceVersion: "1",
910-
SelfLink: "/apis/snapshot.storage.k8s.io/v1beta1/namespaces/" + testNamespace + "/volumesnapshots/" + snapshotName,
910+
SelfLink: "/apis/snapshot.storage.k8s.io/v1/namespaces/" + testNamespace + "/volumesnapshots/" + snapshotName,
911911
DeletionTimestamp: deletionTimestamp,
912912
},
913913
Spec: crdv1.VolumeSnapshotSpec{
@@ -970,7 +970,7 @@ func newSnapshotClass(snapshotClassName, snapshotClassUID, driverName string, is
970970
Namespace: testNamespace,
971971
UID: types.UID(snapshotClassUID),
972972
ResourceVersion: "1",
973-
SelfLink: "/apis/snapshot.storage.k8s.io/v1beta1/namespaces/" + testNamespace + "/volumesnapshotclasses/" + snapshotClassName,
973+
SelfLink: "/apis/snapshot.storage.k8s.io/v1/namespaces/" + testNamespace + "/volumesnapshotclasses/" + snapshotClassName,
974974
},
975975
Driver: driverName,
976976
}

pkg/common-controller/snapshot_controller.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
ref "k8s.io/client-go/tools/reference"
3232
klog "k8s.io/klog/v2"
3333

34-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
34+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
3535
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/metrics"
3636
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/utils"
3737
)
@@ -321,7 +321,7 @@ func (ctrl *csiSnapshotCommonController) checkandRemoveSnapshotFinalizersAndChec
321321
// content won't be deleted immediately due to the VolumeSnapshotContentFinalizer
322322
if content != nil && deleteContent {
323323
klog.V(5).Infof("checkandRemoveSnapshotFinalizersAndCheckandDeleteContent: set DeletionTimeStamp on content [%s].", content.Name)
324-
err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Delete(context.TODO(), content.Name, metav1.DeleteOptions{})
324+
err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Delete(context.TODO(), content.Name, metav1.DeleteOptions{})
325325
if err != nil {
326326
ctrl.eventRecorder.Event(snapshot, v1.EventTypeWarning, "SnapshotContentObjectDeleteError", "Failed to delete snapshot content API object")
327327
return fmt.Errorf("failed to delete VolumeSnapshotContent %s from API server: %q", content.Name, err)
@@ -682,7 +682,7 @@ func (ctrl *csiSnapshotCommonController) createSnapshotContent(snapshot *crdv1.V
682682
klog.V(5).Infof("volume snapshot content %#v", snapshotContent)
683683
// Try to create the VolumeSnapshotContent object
684684
klog.V(5).Infof("createSnapshotContent [%s]: trying to save volume snapshot content %s", utils.SnapshotKey(snapshot), snapshotContent.Name)
685-
if updateContent, err = ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Create(context.TODO(), snapshotContent, metav1.CreateOptions{}); err == nil || apierrs.IsAlreadyExists(err) {
685+
if updateContent, err = ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Create(context.TODO(), snapshotContent, metav1.CreateOptions{}); err == nil || apierrs.IsAlreadyExists(err) {
686686
// Save succeeded.
687687
if err != nil {
688688
klog.V(3).Infof("volume snapshot content %q for snapshot %q already exists, reusing", snapshotContent.Name, utils.SnapshotKey(snapshot))
@@ -780,7 +780,7 @@ func (ctrl *csiSnapshotCommonController) updateSnapshotErrorStatusWithEvent(snap
780780
snapshotClone.Status.Error = statusError
781781
ready := false
782782
snapshotClone.Status.ReadyToUse = &ready
783-
newSnapshot, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(context.TODO(), snapshotClone, metav1.UpdateOptions{})
783+
newSnapshot, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(context.TODO(), snapshotClone, metav1.UpdateOptions{})
784784

785785
// Emit the event even if the status update fails so that user can see the error
786786
ctrl.eventRecorder.Event(newSnapshot, eventtype, reason, message)
@@ -804,7 +804,7 @@ func (ctrl *csiSnapshotCommonController) addContentFinalizer(content *crdv1.Volu
804804
contentClone := content.DeepCopy()
805805
contentClone.ObjectMeta.Finalizers = append(contentClone.ObjectMeta.Finalizers, utils.VolumeSnapshotContentFinalizer)
806806

807-
_, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
807+
_, err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
808808
if err != nil {
809809
return newControllerUpdateError(content.Name, err.Error())
810810
}
@@ -981,7 +981,7 @@ func (ctrl *csiSnapshotCommonController) checkandBindSnapshotContent(snapshot *c
981981
className := *(snapshot.Spec.VolumeSnapshotClassName)
982982
contentClone.Spec.VolumeSnapshotClassName = &className
983983
}
984-
newContent, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
984+
newContent, err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
985985
if err != nil {
986986
klog.V(4).Infof("updating VolumeSnapshotContent[%s] error status failed %v", contentClone.Name, err)
987987
return nil, err
@@ -998,7 +998,7 @@ func (ctrl *csiSnapshotCommonController) checkandBindSnapshotContent(snapshot *c
998998
// This routine sets snapshot.Spec.Source.VolumeSnapshotContentName
999999
func (ctrl *csiSnapshotCommonController) bindandUpdateVolumeSnapshot(snapshotContent *crdv1.VolumeSnapshotContent, snapshot *crdv1.VolumeSnapshot) (*crdv1.VolumeSnapshot, error) {
10001000
klog.V(5).Infof("bindandUpdateVolumeSnapshot for snapshot [%s]: snapshotContent [%s]", snapshot.Name, snapshotContent.Name)
1001-
snapshotObj, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
1001+
snapshotObj, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
10021002
if err != nil {
10031003
return nil, fmt.Errorf("error get snapshot %s from api server: %v", utils.SnapshotKey(snapshot), err)
10041004
}
@@ -1086,7 +1086,7 @@ func (ctrl *csiSnapshotCommonController) updateSnapshotStatus(snapshot *crdv1.Vo
10861086

10871087
klog.V(5).Infof("updateSnapshotStatus: updating VolumeSnapshot [%+v] based on VolumeSnapshotContentStatus [%+v]", snapshot, content.Status)
10881088

1089-
snapshotObj, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
1089+
snapshotObj, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
10901090
if err != nil {
10911091
return nil, fmt.Errorf("error get snapshot %s from api server: %v", utils.SnapshotKey(snapshot), err)
10921092
}
@@ -1157,7 +1157,7 @@ func (ctrl *csiSnapshotCommonController) updateSnapshotStatus(snapshot *crdv1.Vo
11571157
ctrl.metricsManager.RecordMetrics(createAndReadyOperation, metrics.NewSnapshotOperationStatus(metrics.SnapshotStatusTypeSuccess), driverName)
11581158
}
11591159

1160-
newSnapshotObj, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(context.TODO(), snapshotClone, metav1.UpdateOptions{})
1160+
newSnapshotObj, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(context.TODO(), snapshotClone, metav1.UpdateOptions{})
11611161
if err != nil {
11621162
return nil, newControllerUpdateError(utils.SnapshotKey(snapshot), err.Error())
11631163
}
@@ -1322,7 +1322,7 @@ func (ctrl *csiSnapshotCommonController) SetDefaultSnapshotClass(snapshot *crdv1
13221322
klog.V(5).Infof("setDefaultSnapshotClass [%s]: default VolumeSnapshotClassName [%s]", snapshot.Name, defaultClasses[0].Name)
13231323
snapshotClone := snapshot.DeepCopy()
13241324
snapshotClone.Spec.VolumeSnapshotClassName = &(defaultClasses[0].Name)
1325-
newSnapshot, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
1325+
newSnapshot, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
13261326
if err != nil {
13271327
klog.V(4).Infof("updating VolumeSnapshot[%s] default class failed %v", utils.SnapshotKey(snapshot), err)
13281328
}
@@ -1387,7 +1387,7 @@ func (ctrl *csiSnapshotCommonController) addSnapshotFinalizer(snapshot *crdv1.Vo
13871387
if addBoundFinalizer {
13881388
snapshotClone.ObjectMeta.Finalizers = append(snapshotClone.ObjectMeta.Finalizers, utils.VolumeSnapshotBoundFinalizer)
13891389
}
1390-
_, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
1390+
_, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
13911391
if err != nil {
13921392
return newControllerUpdateError(utils.SnapshotKey(snapshot), err.Error())
13931393
}
@@ -1431,7 +1431,7 @@ func (ctrl *csiSnapshotCommonController) removeSnapshotFinalizer(snapshot *crdv1
14311431
if removeBoundFinalizer {
14321432
snapshotClone.ObjectMeta.Finalizers = utils.RemoveString(snapshotClone.ObjectMeta.Finalizers, utils.VolumeSnapshotBoundFinalizer)
14331433
}
1434-
_, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
1434+
_, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshotClone.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
14351435
if err != nil {
14361436
return newControllerUpdateError(snapshot.Name, err.Error())
14371437
}
@@ -1479,7 +1479,7 @@ func (ctrl *csiSnapshotCommonController) setAnnVolumeSnapshotBeingDeleted(conten
14791479
klog.V(5).Infof("setAnnVolumeSnapshotBeingDeleted: set annotation [%s] on content [%s].", utils.AnnVolumeSnapshotBeingDeleted, content.Name)
14801480
metav1.SetMetaDataAnnotation(&content.ObjectMeta, utils.AnnVolumeSnapshotBeingDeleted, "yes")
14811481

1482-
updateContent, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Update(context.TODO(), content, metav1.UpdateOptions{})
1482+
updateContent, err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Update(context.TODO(), content, metav1.UpdateOptions{})
14831483
if err != nil {
14841484
return newControllerUpdateError(content.Name, err.Error())
14851485
}
@@ -1499,7 +1499,7 @@ func (ctrl *csiSnapshotCommonController) setAnnVolumeSnapshotBeingDeleted(conten
14991499
// checkAndSetInvalidContentLabel adds a label to unlabeled invalid content objects and removes the label from valid ones.
15001500
func (ctrl *csiSnapshotCommonController) checkAndSetInvalidContentLabel(content *crdv1.VolumeSnapshotContent) (*crdv1.VolumeSnapshotContent, error) {
15011501
hasLabel := utils.MapContainsKey(content.ObjectMeta.Labels, utils.VolumeSnapshotContentInvalidLabel)
1502-
err := utils.ValidateSnapshotContent(content)
1502+
err := utils.ValidateV1SnapshotContent(content)
15031503
if err != nil {
15041504
klog.Errorf("syncContent[%s]: Invalid content detected, %s", content.Name, err.Error())
15051505
}
@@ -1519,7 +1519,7 @@ func (ctrl *csiSnapshotCommonController) checkAndSetInvalidContentLabel(content
15191519
}
15201520
contentClone.ObjectMeta.Labels[utils.VolumeSnapshotContentInvalidLabel] = ""
15211521
}
1522-
updatedContent, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
1522+
updatedContent, err := ctrl.clientset.SnapshotV1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
15231523
if err != nil {
15241524
return content, newControllerUpdateError(content.Name, err.Error())
15251525
}
@@ -1540,7 +1540,7 @@ func (ctrl *csiSnapshotCommonController) checkAndSetInvalidContentLabel(content
15401540
// checkAndSetInvalidSnapshotLabel adds a label to unlabeled invalid snapshot objects and removes the label from valid ones.
15411541
func (ctrl *csiSnapshotCommonController) checkAndSetInvalidSnapshotLabel(snapshot *crdv1.VolumeSnapshot) (*crdv1.VolumeSnapshot, error) {
15421542
hasLabel := utils.MapContainsKey(snapshot.ObjectMeta.Labels, utils.VolumeSnapshotInvalidLabel)
1543-
err := utils.ValidateSnapshot(snapshot)
1543+
err := utils.ValidateV1Snapshot(snapshot)
15441544
if err != nil {
15451545
klog.Errorf("syncSnapshot[%s]: Invalid snapshot detected, %s", utils.SnapshotKey(snapshot), err.Error())
15461546
}
@@ -1561,7 +1561,7 @@ func (ctrl *csiSnapshotCommonController) checkAndSetInvalidSnapshotLabel(snapsho
15611561
snapshotClone.ObjectMeta.Labels[utils.VolumeSnapshotInvalidLabel] = ""
15621562
}
15631563

1564-
updatedSnapshot, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshots(snapshot.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
1564+
updatedSnapshot, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(snapshot.Namespace).Update(context.TODO(), snapshotClone, metav1.UpdateOptions{})
15651565
if err != nil {
15661566
return snapshot, newControllerUpdateError(utils.SnapshotKey(snapshot), err.Error())
15671567
}

pkg/common-controller/snapshot_controller_base.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
"fmt"
2121
"time"
2222

23-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
23+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
2424
clientset "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned"
25-
storageinformers "github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions/volumesnapshot/v1beta1"
26-
storagelisters "github.com/kubernetes-csi/external-snapshotter/client/v3/listers/volumesnapshot/v1beta1"
25+
storageinformers "github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions/volumesnapshot/v1"
26+
storagelisters "github.com/kubernetes-csi/external-snapshotter/client/v3/listers/volumesnapshot/v1"
2727
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/metrics"
2828
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/utils"
2929

pkg/common-controller/snapshot_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package common_controller
1919
import (
2020
"testing"
2121

22-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
22+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
2323
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/utils"
2424
"k8s.io/client-go/tools/cache"
2525
)

pkg/common-controller/snapshot_create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
24+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
2525
v1 "k8s.io/api/core/v1"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
)

pkg/common-controller/snapshot_delete_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"errors"
2121
"testing"
2222

23-
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1beta1"
23+
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/apis/volumesnapshot/v1"
2424
"github.com/kubernetes-csi/external-snapshotter/v3/pkg/utils"
2525
v1 "k8s.io/api/core/v1"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -195,7 +195,7 @@ func TestDeleteSync(t *testing.T) {
195195
expectedEvents: []string{"Warning SnapshotContentObjectDeleteError"},
196196
initialSecrets: []*v1.Secret{secret()},
197197
errors: []reactorError{
198-
// Inject error to the first client.VolumesnapshotV1beta1().VolumeSnapshotContents().Delete call.
198+
// Inject error to the first client.VolumesnapshotV1().VolumeSnapshotContents().Delete call.
199199
// All other calls will succeed.
200200
{"delete", "volumesnapshotcontents", errors.New("mock delete error")},
201201
},
@@ -278,7 +278,7 @@ func TestDeleteSync(t *testing.T) {
278278
expectedEvents: []string{"Warning SnapshotContentObjectDeleteError"},
279279
initialSecrets: []*v1.Secret{secret()},
280280
errors: []reactorError{
281-
// Inject error to the first client.VolumesnapshotV1beta1().VolumeSnapshotContents().Delete call.
281+
// Inject error to the first client.VolumesnapshotV1().VolumeSnapshotContents().Delete call.
282282
// All other calls will succeed.
283283
{"delete", "volumesnapshotcontents", errors.New("mock delete error")},
284284
},

0 commit comments

Comments
 (0)