@@ -24,7 +24,7 @@ import (
24
24
"testing"
25
25
"time"
26
26
27
- storage "k8s.io/api/storage/v1beta1 "
27
+ storage "k8s.io/api/storage/v1 "
28
28
apierrs "k8s.io/apimachinery/pkg/api/errors"
29
29
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
30
30
"k8s.io/apimachinery/pkg/runtime"
@@ -76,7 +76,7 @@ func markVolumeAttached(t *testing.T, client clientset.Interface, watch *watch.R
76
76
defer ticker .Stop ()
77
77
// wait for attachment to be saved
78
78
for i := 0 ; i < 100 ; i ++ {
79
- attach , err = client .StorageV1beta1 ().VolumeAttachments ().Get (attachID , meta.GetOptions {})
79
+ attach , err = client .StorageV1 ().VolumeAttachments ().Get (attachID , meta.GetOptions {})
80
80
if err != nil {
81
81
if apierrs .IsNotFound (err ) {
82
82
<- ticker .C
@@ -95,7 +95,7 @@ func markVolumeAttached(t *testing.T, client clientset.Interface, watch *watch.R
95
95
t .Logf ("attachment not found for id:%v" , attachID )
96
96
} else {
97
97
attach .Status = status
98
- _ , err := client .StorageV1beta1 ().VolumeAttachments ().Update (attach )
98
+ _ , err := client .StorageV1 ().VolumeAttachments ().Update (attach )
99
99
if err != nil {
100
100
t .Error (err )
101
101
}
@@ -392,11 +392,11 @@ func TestAttacherWaitForAttach(t *testing.T) {
392
392
393
393
if test .makeAttachment != nil {
394
394
attachment := test .makeAttachment ()
395
- _ , err = csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Create (attachment )
395
+ _ , err = csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Create (attachment )
396
396
if err != nil {
397
397
t .Fatalf ("failed to create VolumeAttachment: %v" , err )
398
398
}
399
- gotAttachment , err := csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Get (attachment .Name , meta.GetOptions {})
399
+ gotAttachment , err := csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Get (attachment .Name , meta.GetOptions {})
400
400
if err != nil {
401
401
t .Fatalf ("failed to get created VolumeAttachment: %v" , err )
402
402
}
@@ -484,7 +484,7 @@ func TestAttacherWaitForVolumeAttachment(t *testing.T) {
484
484
attachment := makeTestAttachment (attachID , nodeName , pvName )
485
485
attachment .Status .Attached = tc .initAttached
486
486
attachment .Status .AttachError = tc .initAttachErr
487
- _ , err = csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Create (attachment )
487
+ _ , err = csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Create (attachment )
488
488
if err != nil {
489
489
t .Fatalf ("failed to attach: %v" , err )
490
490
}
@@ -548,7 +548,7 @@ func TestAttacherVolumesAreAttached(t *testing.T) {
548
548
attachID := getAttachmentName (volName , testDriver , nodeName )
549
549
attachment := makeTestAttachment (attachID , nodeName , pv .GetName ())
550
550
attachment .Status .Attached = stat
551
- _ , err := csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Create (attachment )
551
+ _ , err := csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Create (attachment )
552
552
if err != nil {
553
553
t .Fatalf ("failed to attach: %v" , err )
554
554
}
@@ -621,7 +621,7 @@ func TestAttacherDetach(t *testing.T) {
621
621
pv := makeTestPV ("test-pv" , 10 , testDriver , tc .volID )
622
622
spec := volume .NewSpecFromPersistentVolume (pv , pv .Spec .PersistentVolumeSource .CSI .ReadOnly )
623
623
attachment := makeTestAttachment (tc .attachID , nodeName , "test-pv" )
624
- _ , err := csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Create (attachment )
624
+ _ , err := csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Create (attachment )
625
625
if err != nil {
626
626
t .Fatalf ("failed to attach: %v" , err )
627
627
}
@@ -639,7 +639,7 @@ func TestAttacherDetach(t *testing.T) {
639
639
if ! tc .shouldFail && err != nil {
640
640
t .Fatalf ("unexpected err: %v" , err )
641
641
}
642
- attach , err := csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Get (tc .attachID , meta.GetOptions {})
642
+ attach , err := csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Get (tc .attachID , meta.GetOptions {})
643
643
if err != nil {
644
644
if ! apierrs .IsNotFound (err ) {
645
645
t .Fatalf ("unexpected err: %v" , err )
@@ -787,7 +787,7 @@ func TestAttacherMountDevice(t *testing.T) {
787
787
788
788
// Set up volume attachment
789
789
attachment := makeTestAttachment (attachID , nodeName , pvName )
790
- _ , err := csiAttacher .k8s .StorageV1beta1 ().VolumeAttachments ().Create (attachment )
790
+ _ , err := csiAttacher .k8s .StorageV1 ().VolumeAttachments ().Create (attachment )
791
791
if err != nil {
792
792
t .Fatalf ("failed to attach: %v" , err )
793
793
}
0 commit comments