From 1d034b049ba0eba145b2cfb7a645ab9eb7fa6edd Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Mon, 3 Jun 2019 11:06:50 +0100 Subject: [PATCH] Reference "k8s.io/api/core/v1" as corev1, not apiv1 Follow-up to f550c14b7f3e1cfe9c70cc7c5c0fb38263cb7a52 --- .../clusterapi/clusterapi_controller_test.go | 14 +++++++------- .../clusterapi/clusterapi_provider_test.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller_test.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller_test.go index 117306584bf8..6cf2b03e3724 100644 --- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller_test.go +++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - apiv1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -41,7 +41,7 @@ type testConfig struct { machineDeployment *v1alpha1.MachineDeployment machineSet *v1alpha1.MachineSet machines []*v1alpha1.Machine - nodes []*apiv1.Node + nodes []*corev1.Node } type testSpec struct { @@ -132,7 +132,7 @@ func createTestConfigs(specs ...testSpec) []*testConfig { for i, spec := range specs { config := &testConfig{ spec: &specs[i], - nodes: make([]*apiv1.Node, spec.nodeCount), + nodes: make([]*corev1.Node, spec.nodeCount), machines: make([]*v1alpha1.Machine, spec.nodeCount), } @@ -193,8 +193,8 @@ func createTestConfigs(specs ...testSpec) []*testConfig { // makeLinkedNodeAndMachine creates a node and machine. The machine // has its NodeRef set to the new node and the new machine's owner // reference is set to owner. -func makeLinkedNodeAndMachine(i int, namespace string, owner v1.OwnerReference) (*apiv1.Node, *v1alpha1.Machine) { - node := &apiv1.Node{ +func makeLinkedNodeAndMachine(i int, namespace string, owner v1.OwnerReference) (*corev1.Node, *v1alpha1.Machine) { + node := &corev1.Node{ TypeMeta: v1.TypeMeta{ Kind: "Node", }, @@ -204,7 +204,7 @@ func makeLinkedNodeAndMachine(i int, namespace string, owner v1.OwnerReference) machineAnnotationKey: fmt.Sprintf("%s/%s-%s-machine-%d", namespace, namespace, owner.Name, i), }, }, - Spec: apiv1.NodeSpec{ + Spec: corev1.NodeSpec{ ProviderID: fmt.Sprintf("%s-%s-nodeid-%d", namespace, owner.Name, i), }, } @@ -223,7 +223,7 @@ func makeLinkedNodeAndMachine(i int, namespace string, owner v1.OwnerReference) }}, }, Status: v1alpha1.MachineStatus{ - NodeRef: &apiv1.ObjectReference{ + NodeRef: &corev1.ObjectReference{ Kind: node.Kind, Name: node.Name, }, diff --git a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider_test.go b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider_test.go index 507d5d27f4f3..fbcc2248ffb6 100644 --- a/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider_test.go +++ b/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_provider_test.go @@ -20,7 +20,7 @@ import ( "reflect" "testing" - apiv1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" ) @@ -79,7 +79,7 @@ func TestProviderConstructorProperties(t *testing.T) { t.Errorf("expected 0, got %v", len(nodegroups)) } - ng, err := provider.NodeGroupForNode(&apiv1.Node{ + ng, err := provider.NodeGroupForNode(&corev1.Node{ TypeMeta: v1.TypeMeta{ Kind: "Node", },