From 9a6600f9f47d7b63e2153186418e48596d28f017 Mon Sep 17 00:00:00 2001 From: Aaron Crickenberger Date: Thu, 20 Jun 2019 11:40:57 -0700 Subject: [PATCH] add import-alias for k8s.io/api/storage/v1 --- hack/.import-aliases | 3 ++- test/e2e/framework/create.go | 8 ++++---- .../flexvolume_mounted_volume_resize.go | 4 ++-- test/e2e/storage/flexvolume_online_resize.go | 4 ++-- test/e2e/storage/mounted_volume_resize.go | 4 ++-- test/e2e/storage/regional_pd.go | 4 ++-- test/e2e/storage/volume_expand.go | 8 ++++---- test/e2e/storage/volume_provisioning.go | 18 +++++++++--------- test/e2e/storage/vsphere/vsphere_scale.go | 8 ++++---- test/e2e/storage/vsphere/vsphere_stress.go | 8 ++++---- test/e2e/storage/vsphere/vsphere_utils.go | 10 +++++----- .../vsphere/vsphere_volume_ops_storm.go | 4 ++-- .../e2e/storage/vsphere/vsphere_volume_perf.go | 12 ++++++------ 13 files changed, 48 insertions(+), 47 deletions(-) diff --git a/hack/.import-aliases b/hack/.import-aliases index 69de885f52e..41810bccdd2 100644 --- a/hack/.import-aliases +++ b/hack/.import-aliases @@ -30,5 +30,6 @@ "k8s.io/api/scheduling/v1": "schedulingv1", "k8s.io/api/scheduling/v1alpha1": "schedulingv1alpha1", "k8s.io/api/scheduling/v1beta1": "schedulingv1beta1", - "k8s.io/api/settings/v1alpha1": "settingsv1alpha1" + "k8s.io/api/settings/v1alpha1": "settingsv1alpha1", + "k8s.io/api/storage/v1": "storagev1" } \ No newline at end of file diff --git a/test/e2e/framework/create.go b/test/e2e/framework/create.go index 9fb01483712..e98fda76189 100644 --- a/test/e2e/framework/create.go +++ b/test/e2e/framework/create.go @@ -26,7 +26,7 @@ import ( appsv1 "k8s.io/api/apps/v1" "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -325,7 +325,7 @@ func (f *Framework) patchItemRecursively(item interface{}) error { // know whether the referenced role is a ClusterRole or Role // and therefore always renames, we have to do the same here. f.PatchName(&item.Name) - case *storage.StorageClass: + case *storagev1.StorageClass: f.PatchName(&item.Name) case *v1.ServiceAccount: f.PatchNamespace(&item.ObjectMeta.Namespace) @@ -539,11 +539,11 @@ func (*daemonSetFactory) Create(f *Framework, i interface{}) (func() error, erro type storageClassFactory struct{} func (f *storageClassFactory) New() runtime.Object { - return &storage.StorageClass{} + return &storagev1.StorageClass{} } func (*storageClassFactory) Create(f *Framework, i interface{}) (func() error, error) { - item, ok := i.(*storage.StorageClass) + item, ok := i.(*storagev1.StorageClass) if !ok { return nil, errorItemNotSupported } diff --git a/test/e2e/storage/flexvolume_mounted_volume_resize.go b/test/e2e/storage/flexvolume_mounted_volume_resize.go index cb8a24c1ee2..36c442793c1 100644 --- a/test/e2e/storage/flexvolume_mounted_volume_resize.go +++ b/test/e2e/storage/flexvolume_mounted_volume_resize.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" @@ -41,7 +41,7 @@ var _ = utils.SIGDescribe("Mounted flexvolume expand[Slow]", func() { ns string err error pvc *v1.PersistentVolumeClaim - resizableSc *storage.StorageClass + resizableSc *storagev1.StorageClass nodeName string isNodeLabeled bool nodeKeyValueLabel map[string]string diff --git a/test/e2e/storage/flexvolume_online_resize.go b/test/e2e/storage/flexvolume_online_resize.go index 956865e30ea..eb7ed97cae5 100644 --- a/test/e2e/storage/flexvolume_online_resize.go +++ b/test/e2e/storage/flexvolume_online_resize.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" utilerrors "k8s.io/apimachinery/pkg/util/errors" clientset "k8s.io/client-go/kubernetes" @@ -39,7 +39,7 @@ var _ = utils.SIGDescribe("Mounted flexvolume volume expand [Slow] [Feature:Expa ns string err error pvc *v1.PersistentVolumeClaim - resizableSc *storage.StorageClass + resizableSc *storagev1.StorageClass nodeName string isNodeLabeled bool nodeKeyValueLabel map[string]string diff --git a/test/e2e/storage/mounted_volume_resize.go b/test/e2e/storage/mounted_volume_resize.go index 54084a4feb0..43515afe75b 100644 --- a/test/e2e/storage/mounted_volume_resize.go +++ b/test/e2e/storage/mounted_volume_resize.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" @@ -43,7 +43,7 @@ var _ = utils.SIGDescribe("Mounted volume expand", func() { ns string err error pvc *v1.PersistentVolumeClaim - resizableSc *storage.StorageClass + resizableSc *storagev1.StorageClass nodeName string isNodeLabeled bool nodeKeyValueLabel map[string]string diff --git a/test/e2e/storage/regional_pd.go b/test/e2e/storage/regional_pd.go index 19897bc88c2..84e8691b857 100644 --- a/test/e2e/storage/regional_pd.go +++ b/test/e2e/storage/regional_pd.go @@ -28,7 +28,7 @@ import ( appsv1 "k8s.io/api/apps/v1" 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" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" @@ -441,7 +441,7 @@ func getPod(c clientset.Interface, ns string, podLabels map[string]string) *v1.P return &podList.Items[0] } -func addAllowedTopologiesToStorageClass(c clientset.Interface, sc *storage.StorageClass, zones []string) { +func addAllowedTopologiesToStorageClass(c clientset.Interface, sc *storagev1.StorageClass, zones []string) { term := v1.TopologySelectorTerm{ MatchLabelExpressions: []v1.TopologySelectorLabelRequirement{ { diff --git a/test/e2e/storage/volume_expand.go b/test/e2e/storage/volume_expand.go index c3828f9baee..39520ded11e 100644 --- a/test/e2e/storage/volume_expand.go +++ b/test/e2e/storage/volume_expand.go @@ -24,7 +24,7 @@ import ( "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -47,7 +47,7 @@ var _ = utils.SIGDescribe("Volume expand", func() { ns string err error pvc *v1.PersistentVolumeClaim - storageClassVar *storage.StorageClass + storageClassVar *storagev1.StorageClass ) f := framework.NewDefaultFramework("volume-expand") @@ -58,7 +58,7 @@ var _ = utils.SIGDescribe("Volume expand", func() { framework.ExpectNoError(framework.WaitForAllNodesSchedulable(c, framework.TestContext.NodeSchedulableTimeout)) }) - setupFunc := func(allowExpansion bool, blockVolume bool) (*v1.PersistentVolumeClaim, *storage.StorageClass, error) { + setupFunc := func(allowExpansion bool, blockVolume bool) (*v1.PersistentVolumeClaim, *storagev1.StorageClass, error) { test := testsuites.StorageClassTest{ Name: "default", ClaimSize: "2Gi", @@ -241,7 +241,7 @@ var _ = utils.SIGDescribe("Volume expand", func() { }) }) -func createStorageClass(t testsuites.StorageClassTest, ns string, suffix string, c clientset.Interface) (*storage.StorageClass, error) { +func createStorageClass(t testsuites.StorageClassTest, ns string, suffix string, c clientset.Interface) (*storagev1.StorageClass, error) { stKlass := newStorageClass(t, ns, suffix) var err error diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index f7396051525..407dfa31abc 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -30,7 +30,7 @@ import ( v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" storagebeta "k8s.io/api/storage/v1beta1" apierrs "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" @@ -1059,7 +1059,7 @@ func getDefaultPluginName() string { return "" } -func addSingleZoneAllowedTopologyToStorageClass(c clientset.Interface, sc *storage.StorageClass, zone string) { +func addSingleZoneAllowedTopologyToStorageClass(c clientset.Interface, sc *storagev1.StorageClass, zone string) { term := v1.TopologySelectorTerm{ MatchLabelExpressions: []v1.TopologySelectorLabelRequirement{ { @@ -1071,7 +1071,7 @@ func addSingleZoneAllowedTopologyToStorageClass(c clientset.Interface, sc *stora sc.AllowedTopologies = append(sc.AllowedTopologies, term) } -func newStorageClass(t testsuites.StorageClassTest, ns string, suffix string) *storage.StorageClass { +func newStorageClass(t testsuites.StorageClassTest, ns string, suffix string) *storagev1.StorageClass { pluginName := t.Provisioner if pluginName == "" { pluginName = getDefaultPluginName() @@ -1079,9 +1079,9 @@ func newStorageClass(t testsuites.StorageClassTest, ns string, suffix string) *s if suffix == "" { suffix = "sc" } - bindingMode := storage.VolumeBindingImmediate + bindingMode := storagev1.VolumeBindingImmediate if t.DelayBinding { - bindingMode = storage.VolumeBindingWaitForFirstConsumer + bindingMode = storagev1.VolumeBindingWaitForFirstConsumer } sc := getStorageClass(pluginName, t.Parameters, &bindingMode, ns, suffix) if t.AllowVolumeExpansion { @@ -1093,15 +1093,15 @@ func newStorageClass(t testsuites.StorageClassTest, ns string, suffix string) *s func getStorageClass( provisioner string, parameters map[string]string, - bindingMode *storage.VolumeBindingMode, + bindingMode *storagev1.VolumeBindingMode, ns string, suffix string, -) *storage.StorageClass { +) *storagev1.StorageClass { if bindingMode == nil { - defaultBindingMode := storage.VolumeBindingImmediate + defaultBindingMode := storagev1.VolumeBindingImmediate bindingMode = &defaultBindingMode } - return &storage.StorageClass{ + return &storagev1.StorageClass{ TypeMeta: metav1.TypeMeta{ Kind: "StorageClass", }, diff --git a/test/e2e/storage/vsphere/vsphere_scale.go b/test/e2e/storage/vsphere/vsphere_scale.go index 3dd7e4538ba..e043e7eab2d 100644 --- a/test/e2e/storage/vsphere/vsphere_scale.go +++ b/test/e2e/storage/vsphere/vsphere_scale.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" "k8s.io/api/core/v1" - storageV1 "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" "k8s.io/kubernetes/test/e2e/framework" @@ -112,11 +112,11 @@ var _ = utils.SIGDescribe("vcp at scale [Feature:vsphere] ", func() { var pvcClaimList []string nodeVolumeMap := make(map[string][]string) // Volumes will be provisioned with each different types of Storage Class - scArrays := make([]*storageV1.StorageClass, len(scNames)) + scArrays := make([]*storagev1.StorageClass, len(scNames)) for index, scname := range scNames { // Create vSphere Storage Class ginkgo.By(fmt.Sprintf("Creating Storage Class : %q", scname)) - var sc *storageV1.StorageClass + var sc *storagev1.StorageClass scParams := make(map[string]string) var err error switch scname { @@ -181,7 +181,7 @@ func getClaimsForPod(pod *v1.Pod, volumesPerPod int) []string { } // VolumeCreateAndAttach peforms create and attach operations of vSphere persistent volumes at scale -func VolumeCreateAndAttach(client clientset.Interface, namespace string, sc []*storageV1.StorageClass, volumeCountPerInstance int, volumesPerPod int, nodeSelectorList []*NodeSelector, nodeVolumeMapChan chan map[string][]string) { +func VolumeCreateAndAttach(client clientset.Interface, namespace string, sc []*storagev1.StorageClass, volumeCountPerInstance int, volumesPerPod int, nodeSelectorList []*NodeSelector, nodeVolumeMapChan chan map[string][]string) { defer ginkgo.GinkgoRecover() nodeVolumeMap := make(map[string][]string) nodeSelectorIndex := 0 diff --git a/test/e2e/storage/vsphere/vsphere_stress.go b/test/e2e/storage/vsphere/vsphere_stress.go index 144731bcb2f..6be9af31b0d 100644 --- a/test/e2e/storage/vsphere/vsphere_stress.go +++ b/test/e2e/storage/vsphere/vsphere_stress.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" "k8s.io/api/core/v1" - storageV1 "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" "k8s.io/kubernetes/test/e2e/framework" @@ -77,11 +77,11 @@ var _ = utils.SIGDescribe("vsphere cloud provider stress [Feature:vsphere]", fun }) ginkgo.It("vsphere stress tests", func() { - scArrays := make([]*storageV1.StorageClass, len(scNames)) + scArrays := make([]*storagev1.StorageClass, len(scNames)) for index, scname := range scNames { // Create vSphere Storage Class ginkgo.By(fmt.Sprintf("Creating Storage Class : %v", scname)) - var sc *storageV1.StorageClass + var sc *storagev1.StorageClass var err error switch scname { case storageclass1: @@ -121,7 +121,7 @@ var _ = utils.SIGDescribe("vsphere cloud provider stress [Feature:vsphere]", fun }) // goroutine to perform volume lifecycle operations in parallel -func PerformVolumeLifeCycleInParallel(f *framework.Framework, client clientset.Interface, namespace string, instanceId string, sc *storageV1.StorageClass, iterations int, wg *sync.WaitGroup) { +func PerformVolumeLifeCycleInParallel(f *framework.Framework, client clientset.Interface, namespace string, instanceId string, sc *storagev1.StorageClass, iterations int, wg *sync.WaitGroup) { defer wg.Done() defer ginkgo.GinkgoRecover() diff --git a/test/e2e/storage/vsphere/vsphere_utils.go b/test/e2e/storage/vsphere/vsphere_utils.go index c183bf3a481..793e140adc8 100644 --- a/test/e2e/storage/vsphere/vsphere_utils.go +++ b/test/e2e/storage/vsphere/vsphere_utils.go @@ -33,7 +33,7 @@ import ( "k8s.io/klog" v1 "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" @@ -237,10 +237,10 @@ func verifyContentOfVSpherePV(client clientset.Interface, pvc *v1.PersistentVolu e2elog.Logf("Successfully verified content of the volume") } -func getVSphereStorageClassSpec(name string, scParameters map[string]string, zones []string) *storage.StorageClass { - var sc *storage.StorageClass +func getVSphereStorageClassSpec(name string, scParameters map[string]string, zones []string) *storagev1.StorageClass { + var sc *storagev1.StorageClass - sc = &storage.StorageClass{ + sc = &storagev1.StorageClass{ TypeMeta: metav1.TypeMeta{ Kind: "StorageClass", }, @@ -266,7 +266,7 @@ func getVSphereStorageClassSpec(name string, scParameters map[string]string, zon return sc } -func getVSphereClaimSpecWithStorageClass(ns string, diskSize string, storageclass *storage.StorageClass) *v1.PersistentVolumeClaim { +func getVSphereClaimSpecWithStorageClass(ns string, diskSize string, storageclass *storagev1.StorageClass) *v1.PersistentVolumeClaim { claim := &v1.PersistentVolumeClaim{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "pvc-", diff --git a/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go b/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go index af1d482b10b..65d72ba3e0e 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go +++ b/test/e2e/storage/vsphere/vsphere_volume_ops_storm.go @@ -24,7 +24,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" "k8s.io/api/core/v1" - storage "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/storage/utils" @@ -52,7 +52,7 @@ var _ = utils.SIGDescribe("Volume Operations Storm [Feature:vsphere]", func() { var ( client clientset.Interface namespace string - storageclass *storage.StorageClass + storageclass *storagev1.StorageClass pvclaims []*v1.PersistentVolumeClaim persistentvolumes []*v1.PersistentVolume err error diff --git a/test/e2e/storage/vsphere/vsphere_volume_perf.go b/test/e2e/storage/vsphere/vsphere_volume_perf.go index 7873b13b7ab..665ce7c05b4 100644 --- a/test/e2e/storage/vsphere/vsphere_volume_perf.go +++ b/test/e2e/storage/vsphere/vsphere_volume_perf.go @@ -23,7 +23,7 @@ import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" - storageV1 "k8s.io/api/storage/v1" + storagev1 "k8s.io/api/storage/v1" clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" e2elog "k8s.io/kubernetes/test/e2e/framework/log" @@ -89,7 +89,7 @@ var _ = utils.SIGDescribe("vcp-performance [Feature:vsphere]", func() { ginkgo.It("vcp performance tests", func() { scList := getTestStorageClasses(client, policyName, datastoreName) - defer func(scList []*storageV1.StorageClass) { + defer func(scList []*storagev1.StorageClass) { for _, sc := range scList { client.StorageV1().StorageClasses().Delete(sc.Name, nil) } @@ -113,7 +113,7 @@ var _ = utils.SIGDescribe("vcp-performance [Feature:vsphere]", func() { }) }) -func getTestStorageClasses(client clientset.Interface, policyName, datastoreName string) []*storageV1.StorageClass { +func getTestStorageClasses(client clientset.Interface, policyName, datastoreName string) []*storagev1.StorageClass { const ( storageclass1 = "sc-default" storageclass2 = "sc-vsan" @@ -121,11 +121,11 @@ func getTestStorageClasses(client clientset.Interface, policyName, datastoreName storageclass4 = "sc-user-specified-ds" ) scNames := []string{storageclass1, storageclass2, storageclass3, storageclass4} - scArrays := make([]*storageV1.StorageClass, len(scNames)) + scArrays := make([]*storagev1.StorageClass, len(scNames)) for index, scname := range scNames { // Create vSphere Storage Class ginkgo.By(fmt.Sprintf("Creating Storage Class : %v", scname)) - var sc *storageV1.StorageClass + var sc *storagev1.StorageClass var err error switch scname { case storageclass1: @@ -155,7 +155,7 @@ func getTestStorageClasses(client clientset.Interface, policyName, datastoreName } // invokeVolumeLifeCyclePerformance peforms full volume life cycle management and records latency for each operation -func invokeVolumeLifeCyclePerformance(f *framework.Framework, client clientset.Interface, namespace string, sc []*storageV1.StorageClass, volumesPerPod int, volumeCount int, nodeSelectorList []*NodeSelector) (latency map[string]float64) { +func invokeVolumeLifeCyclePerformance(f *framework.Framework, client clientset.Interface, namespace string, sc []*storagev1.StorageClass, volumesPerPod int, volumeCount int, nodeSelectorList []*NodeSelector) (latency map[string]float64) { var ( totalpvclaims [][]*v1.PersistentVolumeClaim totalpvs [][]*v1.PersistentVolume