More specific import aliases

pull/58/head
Sean Sullivan 2018-09-24 11:39:33 -07:00
parent 219246eaad
commit 446fbd51e3
1 changed files with 11 additions and 11 deletions

View File

@ -33,9 +33,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/cli-runtime/pkg/genericclioptions"
batch "k8s.io/api/batch/v1" batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1" policyv1beta1 "k8s.io/api/policy/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -273,14 +273,14 @@ func TestDrain(t *testing.T) {
}, },
} }
ds := extensions.DaemonSet{ ds := extensionsv1beta1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "ds", Name: "ds",
Namespace: "default", Namespace: "default",
CreationTimestamp: metav1.Time{Time: time.Now()}, CreationTimestamp: metav1.Time{Time: time.Now()},
SelfLink: testapi.Default.SelfLink("daemonsets", "ds"), SelfLink: testapi.Default.SelfLink("daemonsets", "ds"),
}, },
Spec: extensions.DaemonSetSpec{ Spec: extensionsv1beta1.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels}, Selector: &metav1.LabelSelector{MatchLabels: labels},
}, },
} }
@ -373,14 +373,14 @@ func TestDrain(t *testing.T) {
}, },
} }
job := batch.Job{ job := batchv1.Job{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "job", Name: "job",
Namespace: "default", Namespace: "default",
CreationTimestamp: metav1.Time{Time: time.Now()}, CreationTimestamp: metav1.Time{Time: time.Now()},
SelfLink: testapi.Default.SelfLink("jobs", "job"), SelfLink: testapi.Default.SelfLink("jobs", "job"),
}, },
Spec: batch.JobSpec{ Spec: batchv1.JobSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels}, Selector: &metav1.LabelSelector{MatchLabels: labels},
}, },
} }
@ -444,7 +444,7 @@ func TestDrain(t *testing.T) {
}, },
} }
rs := extensions.ReplicaSet{ rs := extensionsv1beta1.ReplicaSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "rs", Name: "rs",
Namespace: "default", Namespace: "default",
@ -452,7 +452,7 @@ func TestDrain(t *testing.T) {
Labels: labels, Labels: labels,
SelfLink: testapi.Default.SelfLink("replicasets", "rs"), SelfLink: testapi.Default.SelfLink("replicasets", "rs"),
}, },
Spec: extensions.ReplicaSetSpec{ Spec: extensionsv1beta1.ReplicaSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: labels}, Selector: &metav1.LabelSelector{MatchLabels: labels},
}, },
} }
@ -535,7 +535,7 @@ func TestDrain(t *testing.T) {
expected *corev1.Node expected *corev1.Node
pods []corev1.Pod pods []corev1.Pod
rcs []corev1.ReplicationController rcs []corev1.ReplicationController
replicaSets []extensions.ReplicaSet replicaSets []extensionsv1beta1.ReplicaSet
args []string args []string
expectWarning string expectWarning string
expectFatal bool expectFatal bool
@ -637,7 +637,7 @@ func TestDrain(t *testing.T) {
node: node, node: node,
expected: cordoned_node, expected: cordoned_node,
pods: []corev1.Pod{rs_pod}, pods: []corev1.Pod{rs_pod},
replicaSets: []extensions.ReplicaSet{rs}, replicaSets: []extensionsv1beta1.ReplicaSet{rs},
args: []string{"node"}, args: []string{"node"},
expectFatal: false, expectFatal: false,
expectDelete: true, expectDelete: true,
@ -765,7 +765,7 @@ func TestDrain(t *testing.T) {
case m.isFor("GET", "/namespaces/default/daemonsets/ds"): case m.isFor("GET", "/namespaces/default/daemonsets/ds"):
return &http.Response{StatusCode: 200, Header: defaultHeader(), Body: objBody(testapi.Extensions.Codec(), &ds)}, nil return &http.Response{StatusCode: 200, Header: defaultHeader(), Body: objBody(testapi.Extensions.Codec(), &ds)}, nil
case m.isFor("GET", "/namespaces/default/daemonsets/missing-ds"): case m.isFor("GET", "/namespaces/default/daemonsets/missing-ds"):
return &http.Response{StatusCode: 404, Header: defaultHeader(), Body: objBody(testapi.Extensions.Codec(), &extensions.DaemonSet{})}, nil return &http.Response{StatusCode: 404, Header: defaultHeader(), Body: objBody(testapi.Extensions.Codec(), &extensionsv1beta1.DaemonSet{})}, nil
case m.isFor("GET", "/namespaces/default/jobs/job"): case m.isFor("GET", "/namespaces/default/jobs/job"):
return &http.Response{StatusCode: 200, Header: defaultHeader(), Body: objBody(testapi.Batch.Codec(), &job)}, nil return &http.Response{StatusCode: 200, Header: defaultHeader(), Body: objBody(testapi.Batch.Codec(), &job)}, nil
case m.isFor("GET", "/namespaces/default/replicasets/rs"): case m.isFor("GET", "/namespaces/default/replicasets/rs"):