@@ -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"
@@ -314,21 +314,21 @@ var _ = utils.SIGDescribe("Zone Support", func() {
314
314
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 () {
315
315
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode and storage policy :%s" , compatPolicy ))
316
316
scParameters [SpbmStoragePolicy ] = compatPolicy
317
- verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , nil , storage .VolumeBindingWaitForFirstConsumer )
317
+ verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , nil , storagev1 .VolumeBindingWaitForFirstConsumer )
318
318
})
319
319
320
320
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 () {
321
321
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode, storage policy :%s and zone :%s" , compatPolicy , zoneA ))
322
322
scParameters [SpbmStoragePolicy ] = compatPolicy
323
323
zones = append (zones , zoneA )
324
- verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer )
324
+ verifyPVCAndPodCreationSucceeds (client , namespace , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
325
325
})
326
326
327
327
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 () {
328
328
ginkgo .By (fmt .Sprintf ("Creating storage class with waitForFirstConsumer mode and zones : %s, %s" , zoneA , zoneB ))
329
329
zones = append (zones , zoneA )
330
330
zones = append (zones , zoneB )
331
- verifyPVCAndPodCreationSucceeds (client , namespace , nil , zones , storage .VolumeBindingWaitForFirstConsumer )
331
+ verifyPVCAndPodCreationSucceeds (client , namespace , nil , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
332
332
})
333
333
334
334
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 () {
@@ -352,11 +352,11 @@ var _ = utils.SIGDescribe("Zone Support", func() {
352
352
// nodeSelector set as zoneB
353
353
v1 .LabelZoneFailureDomain : zoneB ,
354
354
}
355
- verifyPodSchedulingFails (client , namespace , nodeSelectorMap , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer )
355
+ verifyPodSchedulingFails (client , namespace , nodeSelectorMap , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer )
356
356
})
357
357
})
358
358
359
- func verifyPVCAndPodCreationSucceeds (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) {
359
+ func verifyPVCAndPodCreationSucceeds (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) {
360
360
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
361
361
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
362
362
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
@@ -371,15 +371,15 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
371
371
372
372
var persistentvolumes []* v1.PersistentVolume
373
373
// If WaitForFirstConsumer mode, verify pvc binding status after pod creation. For immediate mode, do now.
374
- if volumeBindingMode != storage .VolumeBindingWaitForFirstConsumer {
374
+ if volumeBindingMode != storagev1 .VolumeBindingWaitForFirstConsumer {
375
375
persistentvolumes = waitForPVClaimBoundPhase (client , pvclaims , framework .ClaimProvisionTimeout )
376
376
}
377
377
378
378
ginkgo .By ("Creating pod to attach PV to the node" )
379
379
pod , err := e2epod .CreatePod (client , namespace , nil , pvclaims , false , "" )
380
380
framework .ExpectNoError (err )
381
381
382
- if volumeBindingMode == storage .VolumeBindingWaitForFirstConsumer {
382
+ if volumeBindingMode == storagev1 .VolumeBindingWaitForFirstConsumer {
383
383
persistentvolumes = waitForPVClaimBoundPhase (client , pvclaims , framework .ClaimProvisionTimeout )
384
384
}
385
385
@@ -399,7 +399,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
399
399
}
400
400
401
401
func verifyPodAndPvcCreationFailureOnWaitForFirstConsumerMode (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string ) error {
402
- storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , storage .VolumeBindingWaitForFirstConsumer ))
402
+ storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , storagev1 .VolumeBindingWaitForFirstConsumer ))
403
403
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
404
404
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
405
405
@@ -438,7 +438,7 @@ func waitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist
438
438
return persistentvolumes
439
439
}
440
440
441
- func verifyPodSchedulingFails (client clientset.Interface , namespace string , nodeSelector map [string ]string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) {
441
+ func verifyPodSchedulingFails (client clientset.Interface , namespace string , nodeSelector map [string ]string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) {
442
442
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
443
443
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
444
444
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
@@ -457,7 +457,7 @@ func verifyPodSchedulingFails(client clientset.Interface, namespace string, node
457
457
defer e2epod .DeletePodWithWait (client , pod )
458
458
}
459
459
460
- func verifyPVCCreationFails (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storage .VolumeBindingMode ) error {
460
+ func verifyPVCCreationFails (client clientset.Interface , namespace string , scParameters map [string ]string , zones []string , volumeBindingMode storagev1 .VolumeBindingMode ) error {
461
461
storageclass , err := client .StorageV1 ().StorageClasses ().Create (getVSphereStorageClassSpec ("zone-sc" , scParameters , zones , volumeBindingMode ))
462
462
framework .ExpectNoError (err , fmt .Sprintf ("Failed to create storage class with err: %v" , err ))
463
463
defer client .StorageV1 ().StorageClasses ().Delete (storageclass .Name , nil )
0 commit comments