Skip to content

Commit 8f17e46

Browse files
authored
Merge pull request kubernetes#81943 from dims/update-import-aliases-for-1.16-test-e2e
Use preferred import packages for test/e2e
2 parents 6c45b3c + 46cc8ad commit 8f17e46

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

test/e2e/framework/suites.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"k8s.io/klog"
2626

27-
corev1 "k8s.io/api/core/v1"
27+
v1 "k8s.io/api/core/v1"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2929
"k8s.io/kubernetes/pkg/version"
3030
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
@@ -62,7 +62,7 @@ func SetupSuite() {
6262
metav1.NamespaceSystem,
6363
metav1.NamespaceDefault,
6464
metav1.NamespacePublic,
65-
corev1.NamespaceNodeLease,
65+
v1.NamespaceNodeLease,
6666
})
6767
if err != nil {
6868
e2elog.Failf("Error deleting orphaned namespaces: %v", err)

test/e2e/network/dual_stack.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/onsi/ginkgo"
2424
"github.com/onsi/gomega"
2525

26-
apps "k8s.io/api/apps/v1"
26+
appsv1 "k8s.io/api/apps/v1"
2727
v1 "k8s.io/api/core/v1"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2929
clientset "k8s.io/client-go/kubernetes"
@@ -136,7 +136,7 @@ var _ = SIGDescribe("[Feature:IPv6DualStackAlphaFeature] [LinuxOnly]", func() {
136136
map[string]string{"test": "dual-stack-server"},
137137
"dualstack-test-server",
138138
imageutils.GetE2EImage(imageutils.TestWebserver),
139-
apps.RollingUpdateDeploymentStrategyType)
139+
appsv1.RollingUpdateDeploymentStrategyType)
140140

141141
// to ensure all the pods land on different nodes and we can thereby
142142
// validate connectivity across all nodes.
@@ -164,7 +164,7 @@ var _ = SIGDescribe("[Feature:IPv6DualStackAlphaFeature] [LinuxOnly]", func() {
164164
map[string]string{"test": "dual-stack-client"},
165165
"dualstack-test-client",
166166
imageutils.GetE2EImage(imageutils.Agnhost),
167-
apps.RollingUpdateDeploymentStrategyType)
167+
appsv1.RollingUpdateDeploymentStrategyType)
168168

169169
clientDeploymentSpec.Spec.Template.Spec.Containers[0].Command = []string{"sleep", "3600"}
170170
clientDeploymentSpec.Spec.Template.Spec.Affinity = &v1.Affinity{

test/e2e/storage/vsphere/vsphere_zone_support.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/onsi/gomega"
2626

2727
v1 "k8s.io/api/core/v1"
28-
storage "k8s.io/api/storage/v1"
28+
storagev1 "k8s.io/api/storage/v1"
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
clientset "k8s.io/client-go/kubernetes"
3131
volumeevents "k8s.io/kubernetes/pkg/controller/volume/events"
@@ -314,21 +314,21 @@ var _ = utils.SIGDescribe("Zone Support", func() {
314314
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() {
315315
ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode and storage policy :%s", compatPolicy))
316316
scParameters[SpbmStoragePolicy] = compatPolicy
317-
verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, nil, storage.VolumeBindingWaitForFirstConsumer)
317+
verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, nil, storagev1.VolumeBindingWaitForFirstConsumer)
318318
})
319319

320320
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() {
321321
ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode, storage policy :%s and zone :%s", compatPolicy, zoneA))
322322
scParameters[SpbmStoragePolicy] = compatPolicy
323323
zones = append(zones, zoneA)
324-
verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, zones, storage.VolumeBindingWaitForFirstConsumer)
324+
verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer)
325325
})
326326

327327
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() {
328328
ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode and zones : %s, %s", zoneA, zoneB))
329329
zones = append(zones, zoneA)
330330
zones = append(zones, zoneB)
331-
verifyPVCAndPodCreationSucceeds(client, namespace, nil, zones, storage.VolumeBindingWaitForFirstConsumer)
331+
verifyPVCAndPodCreationSucceeds(client, namespace, nil, zones, storagev1.VolumeBindingWaitForFirstConsumer)
332332
})
333333

334334
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() {
352352
// nodeSelector set as zoneB
353353
v1.LabelZoneFailureDomain: zoneB,
354354
}
355-
verifyPodSchedulingFails(client, namespace, nodeSelectorMap, scParameters, zones, storage.VolumeBindingWaitForFirstConsumer)
355+
verifyPodSchedulingFails(client, namespace, nodeSelectorMap, scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer)
356356
})
357357
})
358358

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) {
360360
storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode))
361361
framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err))
362362
defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil)
@@ -371,15 +371,15 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
371371

372372
var persistentvolumes []*v1.PersistentVolume
373373
// 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 {
375375
persistentvolumes = waitForPVClaimBoundPhase(client, pvclaims, framework.ClaimProvisionTimeout)
376376
}
377377

378378
ginkgo.By("Creating pod to attach PV to the node")
379379
pod, err := e2epod.CreatePod(client, namespace, nil, pvclaims, false, "")
380380
framework.ExpectNoError(err)
381381

382-
if volumeBindingMode == storage.VolumeBindingWaitForFirstConsumer {
382+
if volumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer {
383383
persistentvolumes = waitForPVClaimBoundPhase(client, pvclaims, framework.ClaimProvisionTimeout)
384384
}
385385

@@ -399,7 +399,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin
399399
}
400400

401401
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))
403403
framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err))
404404
defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil)
405405

@@ -438,7 +438,7 @@ func waitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist
438438
return persistentvolumes
439439
}
440440

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) {
442442
storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode))
443443
framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err))
444444
defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil)
@@ -457,7 +457,7 @@ func verifyPodSchedulingFails(client clientset.Interface, namespace string, node
457457
defer e2epod.DeletePodWithWait(client, pod)
458458
}
459459

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 {
461461
storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode))
462462
framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err))
463463
defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil)

0 commit comments

Comments
 (0)