From 46cc8adcc3d972971747913a1b614415542773d0 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 26 Aug 2019 08:56:38 -0400 Subject: [PATCH] Use preferred import packages for test/e2e Ran `hack/update-import-aliases.sh` Change-Id: Ieaf3599a80ec90026b2c83f25c797d121a461549 --- test/e2e/framework/suites.go | 4 ++-- test/e2e/network/dual_stack.go | 6 ++--- .../storage/vsphere/vsphere_zone_support.go | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/e2e/framework/suites.go b/test/e2e/framework/suites.go index 823d8273336..a68eb4945fd 100644 --- a/test/e2e/framework/suites.go +++ b/test/e2e/framework/suites.go @@ -24,7 +24,7 @@ import ( "k8s.io/klog" - corev1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/kubernetes/pkg/version" e2elog "k8s.io/kubernetes/test/e2e/framework/log" @@ -62,7 +62,7 @@ func SetupSuite() { metav1.NamespaceSystem, metav1.NamespaceDefault, metav1.NamespacePublic, - corev1.NamespaceNodeLease, + v1.NamespaceNodeLease, }) if err != nil { e2elog.Failf("Error deleting orphaned namespaces: %v", err) diff --git a/test/e2e/network/dual_stack.go b/test/e2e/network/dual_stack.go index 3306589b352..eddcab63b8b 100644 --- a/test/e2e/network/dual_stack.go +++ b/test/e2e/network/dual_stack.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" - apps "k8s.io/api/apps/v1" + appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" @@ -136,7 +136,7 @@ var _ = SIGDescribe("[Feature:IPv6DualStackAlphaFeature] [LinuxOnly]", func() { map[string]string{"test": "dual-stack-server"}, "dualstack-test-server", imageutils.GetE2EImage(imageutils.TestWebserver), - apps.RollingUpdateDeploymentStrategyType) + appsv1.RollingUpdateDeploymentStrategyType) // to ensure all the pods land on different nodes and we can thereby // validate connectivity across all nodes. @@ -164,7 +164,7 @@ var _ = SIGDescribe("[Feature:IPv6DualStackAlphaFeature] [LinuxOnly]", func() { map[string]string{"test": "dual-stack-client"}, "dualstack-test-client", imageutils.GetE2EImage(imageutils.Agnhost), - apps.RollingUpdateDeploymentStrategyType) + appsv1.RollingUpdateDeploymentStrategyType) clientDeploymentSpec.Spec.Template.Spec.Containers[0].Command = []string{"sleep", "3600"} clientDeploymentSpec.Spec.Template.Spec.Affinity = &v1.Affinity{ diff --git a/test/e2e/storage/vsphere/vsphere_zone_support.go b/test/e2e/storage/vsphere/vsphere_zone_support.go index 03373a8fb7e..5561f2c891c 100644 --- a/test/e2e/storage/vsphere/vsphere_zone_support.go +++ b/test/e2e/storage/vsphere/vsphere_zone_support.go @@ -25,7 +25,7 @@ import ( "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" volumeevents "k8s.io/kubernetes/pkg/controller/volume/events" @@ -313,21 +313,21 @@ var _ = utils.SIGDescribe("Zone Support", func() { 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() { ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode and storage policy :%s", compatPolicy)) scParameters[SpbmStoragePolicy] = compatPolicy - verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, nil, storage.VolumeBindingWaitForFirstConsumer) + verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, nil, storagev1.VolumeBindingWaitForFirstConsumer) }) 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() { ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode, storage policy :%s and zone :%s", compatPolicy, zoneA)) scParameters[SpbmStoragePolicy] = compatPolicy zones = append(zones, zoneA) - verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, zones, storage.VolumeBindingWaitForFirstConsumer) + verifyPVCAndPodCreationSucceeds(client, namespace, scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer) }) 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() { ginkgo.By(fmt.Sprintf("Creating storage class with waitForFirstConsumer mode and zones : %s, %s", zoneA, zoneB)) zones = append(zones, zoneA) zones = append(zones, zoneB) - verifyPVCAndPodCreationSucceeds(client, namespace, nil, zones, storage.VolumeBindingWaitForFirstConsumer) + verifyPVCAndPodCreationSucceeds(client, namespace, nil, zones, storagev1.VolumeBindingWaitForFirstConsumer) }) 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() { // nodeSelector set as zoneB v1.LabelZoneFailureDomain: zoneB, } - verifyPodSchedulingFails(client, namespace, nodeSelectorMap, scParameters, zones, storage.VolumeBindingWaitForFirstConsumer) + verifyPodSchedulingFails(client, namespace, nodeSelectorMap, scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer) }) }) -func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storage.VolumeBindingMode) { +func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) { storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode)) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil) @@ -370,7 +370,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin var persistentvolumes []*v1.PersistentVolume // If WaitForFirstConsumer mode, verify pvc binding status after pod creation. For immediate mode, do now. - if volumeBindingMode != storage.VolumeBindingWaitForFirstConsumer { + if volumeBindingMode != storagev1.VolumeBindingWaitForFirstConsumer { persistentvolumes = waitForPVClaimBoundPhase(client, pvclaims, framework.ClaimProvisionTimeout) } @@ -378,7 +378,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin pod, err := framework.CreatePod(client, namespace, nil, pvclaims, false, "") framework.ExpectNoError(err) - if volumeBindingMode == storage.VolumeBindingWaitForFirstConsumer { + if volumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer { persistentvolumes = waitForPVClaimBoundPhase(client, pvclaims, framework.ClaimProvisionTimeout) } @@ -398,7 +398,7 @@ func verifyPVCAndPodCreationSucceeds(client clientset.Interface, namespace strin } func verifyPodAndPvcCreationFailureOnWaitForFirstConsumerMode(client clientset.Interface, namespace string, scParameters map[string]string, zones []string) error { - storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, storage.VolumeBindingWaitForFirstConsumer)) + storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, storagev1.VolumeBindingWaitForFirstConsumer)) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil) @@ -437,7 +437,7 @@ func waitForPVClaimBoundPhase(client clientset.Interface, pvclaims []*v1.Persist return persistentvolumes } -func verifyPodSchedulingFails(client clientset.Interface, namespace string, nodeSelector map[string]string, scParameters map[string]string, zones []string, volumeBindingMode storage.VolumeBindingMode) { +func verifyPodSchedulingFails(client clientset.Interface, namespace string, nodeSelector map[string]string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) { storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode)) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil) @@ -456,7 +456,7 @@ func verifyPodSchedulingFails(client clientset.Interface, namespace string, node defer framework.DeletePodWithWait(f, client, pod) } -func verifyPVCCreationFails(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storage.VolumeBindingMode) error { +func verifyPVCCreationFails(client clientset.Interface, namespace string, scParameters map[string]string, zones []string, volumeBindingMode storagev1.VolumeBindingMode) error { storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec("zone-sc", scParameters, zones, volumeBindingMode)) framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err)) defer client.StorageV1().StorageClasses().Delete(storageclass.Name, nil)