@@ -25,7 +25,7 @@ import (
25
25
"github.com/onsi/gomega"
26
26
27
27
v1 "k8s.io/api/core/v1"
28
- storage "k8s.io/api/storage/v1"
28
+ storagev1 "k8s.io/api/storage/v1"
29
29
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30
30
clientset "k8s.io/client-go/kubernetes"
31
31
volumeevents "k8s.io/kubernetes/pkg/controller/volume/events"
@@ -313,21 +313,21 @@ var _ = utils.SIGDescribe("Zone Support", func() {
313
313
ginkgo .It ("Verify a pod is created and attached to a dynamically created PV with storage policy specified in storage class in waitForFirstConsumer binding mode" , func () {
314
314
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode and storage policy :%s" , compatPolicy ))
315
315
scParameters [SpbmStoragePolicy ] = compatPolicy
316
- verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , nil , storage .VolumeBindingWaitForFirstConsumer )
316
+ verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , nil , storagev1 .VolumeBindingWaitForFirstConsumer )
317
317
})
318
318
319
319
ginkgo .It ("Verify a pod is created and attached to a dynamically created PV with storage policy specified in storage class in waitForFirstConsumer binding mode with allowedTopologies" , func () {
320
320
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode, storage policy :%s and zone :%s" , compatPolicy , zoneA ))
321
321
scParameters [SpbmStoragePolicy ] = compatPolicy
322
322
zones = append (zones , zoneA )
323
- verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer )
323
+ verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
324
324
})
325
325
326
326
ginkgo .It ("Verify a pod is created and attached to a dynamically created PV with storage policy specified in storage class in waitForFirstConsumer binding mode with multiple allowedTopologies" , func () {
327
327
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode and zones : %s, %s" , zoneA , zoneB ))
328
328
zones = append (zones , zoneA )
329
329
zones = append (zones , zoneB )
330
- verifyPVCAndPodCreationSucceeds (client , namespace , nil , zones , storage .VolumeBindingWaitForFirstConsumer )
330
+ verifyPVCAndPodCreationSucceeds (client , namespace , nil , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
331
331
})
332
332
333
333
ginkgo .It ("Verify a PVC creation fails when multiple zones are specified in the storage class without shared datastores among the zones in waitForFirstConsumer binding mode" , func () {
@@ -351,11 +351,11 @@ var _ = utils.SIGDescribe("Zone Support", func() {
351
351
// nodeSelector set as zoneB
352
352
v1 .LabelZoneFailureDomain : zoneB ,
353
353
}
354
- verifyPodSchedulingFails (client , namespace , nodeSelectorMap , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer )
354
+ verifyPodSchedulingFails (client , namespace , nodeSelectorMap , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
355
355
})
356
356
})
357
357
358
- func verifyPVCAndPodCreationSucceeds (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) {
358
+ func verifyPVCAndPodCreationSucceeds (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) {
359
359
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
360
360
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
361
361
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
@@ -370,15 +370,15 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
370
370
371
371
var persistentvolumes []* v1.PersistentVolume
372
372
// If WaitForFirstConsumer mode, verify pvc binding status after pod creation. For immediate mode, do now.
373
- if volumeBindingMode != storage .VolumeBindingWaitForFirstConsumer {
373
+ if volumeBindingMode != storagev1 .VolumeBindingWaitForFirstConsumer {
374
374
persistentvolumes = waitForPVClaimBoundPhase (client , pvclaims , framework .ClaimProvisionTimeout )
375
375
}
376
376
377
377
ginkgo .By ("Creating pod to attach PV to the node" )
378
378
pod , err := framework .CreatePod (client , namespace , nil , pvclaims , false , "" )
379
379
framework .ExpectNoError (err )
380
380
381
- if volumeBindingMode == storage .VolumeBindingWaitForFirstConsumer {
381
+ if volumeBindingMode == storagev1 .VolumeBindingWaitForFirstConsumer {
382
382
persistentvolumes = waitForPVClaimBoundPhase (client , pvclaims , framework .ClaimProvisionTimeout )
383
383
}
384
384
@@ -398,7 +398,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
398
398
}
399
399
400
400
func verifyPodAndPvcCreationFailureOnWaitForFirstConsumerMode (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string ) error {
401
- storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer ))
401
+ storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer ))
402
402
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
403
403
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
404
404
@@ -437,7 +437,7 @@ func waitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist
437
437
return persistentvolumes
438
438
}
439
439
440
- func verifyPodSchedulingFails (client clientset.Interface , namespace string , nodeSelector map [string ]string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) {
440
+ func verifyPodSchedulingFails (client clientset.Interface , namespace string , nodeSelector map [string ]string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) {
441
441
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
442
442
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
443
443
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
@@ -456,7 +456,7 @@ func verifyPodSchedulingFails(client clientset.Interface, namespace string, node
456
456
defer framework .DeletePodWithWait (f , client , pod )
457
457
}
458
458
459
- func verifyPVCCreationFails (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) error {
459
+ func verifyPVCCreationFails (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) error {
460
460
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
461
461
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
462
462
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
0 commit comments