Skip to content

Commit

Permalink
Reference "k8s.io/api/core/v1" as corev1, not apiv1
Browse files Browse the repository at this point in the history
Follow-up to f550c14
  • Loading branch information
frobware committed Mar 2, 2020
1 parent 9693951 commit d4cbacb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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),
}

Expand Down Expand Up @@ -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",
},
Expand All @@ -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),
},
}
Expand All @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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",
},
Expand Down

0 comments on commit d4cbacb

Please sign in to comment.