Changes to be more consistent about import aliases and group/kind

This commit is contained in:
Sean Sullivan
2018-09-26 13:42:25 -07:00
parent 49852289de
commit 4e8e2705b0
10 changed files with 154 additions and 164 deletions

View File

@@ -19,8 +19,8 @@ package polymorphichelpers
import (
"testing"
api "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
corev1 "k8s.io/api/core/v1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -32,8 +32,8 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectErr bool
}{
{
object: &api.ReplicationController{
Spec: api.ReplicationControllerSpec{
object: &corev1.ReplicationController{
Spec: corev1.ReplicationControllerSpec{
Selector: map[string]string{
"foo": "bar",
},
@@ -42,11 +42,11 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectSelector: "foo=bar",
},
{
object: &api.Pod{},
object: &corev1.Pod{},
expectErr: true,
},
{
object: &api.Pod{
object: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
@@ -56,8 +56,8 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectSelector: "foo=bar",
},
{
object: &api.Service{
Spec: api.ServiceSpec{
object: &corev1.Service{
Spec: corev1.ServiceSpec{
Selector: map[string]string{
"foo": "bar",
},
@@ -66,12 +66,12 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectSelector: "foo=bar",
},
{
object: &api.Service{},
object: &corev1.Service{},
expectErr: true,
},
{
object: &extensions.Deployment{
Spec: extensions.DeploymentSpec{
object: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"foo": "bar",
@@ -82,8 +82,8 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectSelector: "foo=bar",
},
{
object: &extensions.Deployment{
Spec: extensions.DeploymentSpec{
object: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
@@ -96,8 +96,8 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectErr: true,
},
{
object: &extensions.ReplicaSet{
Spec: extensions.ReplicaSetSpec{
object: &extensionsv1beta1.ReplicaSet{
Spec: extensionsv1beta1.ReplicaSetSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"foo": "bar",
@@ -108,8 +108,8 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectSelector: "foo=bar",
},
{
object: &extensions.ReplicaSet{
Spec: extensions.ReplicaSetSpec{
object: &extensionsv1beta1.ReplicaSet{
Spec: extensionsv1beta1.ReplicaSetSpec{
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
@@ -122,7 +122,7 @@ func TestMapBasedSelectorForObject(t *testing.T) {
expectErr: true,
},
{
object: &api.Node{},
object: &corev1.Node{},
expectErr: true,
},
}