refactor: use metav1.ObjectMeta in other types

This commit is contained in:
Clayton Coleman
2017-01-16 22:38:19 -05:00
parent 5a5d31555b
commit 9a2a50cda7
822 changed files with 11914 additions and 9290 deletions

View File

@@ -20,6 +20,7 @@ import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/v1"
@@ -30,7 +31,7 @@ import (
const region = "us-central"
func newService(name string, uid types.UID, serviceType v1.ServiceType) *v1.Service {
return &v1.Service{ObjectMeta: v1.ObjectMeta{Name: name, Namespace: "namespace", UID: uid, SelfLink: testapi.Default.SelfLink("services", name)}, Spec: v1.ServiceSpec{Type: serviceType}}
return &v1.Service{ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: "namespace", UID: uid, SelfLink: testapi.Default.SelfLink("services", name)}, Spec: v1.ServiceSpec{Type: serviceType}}
}
func TestCreateExternalLoadBalancer(t *testing.T) {
@@ -41,7 +42,7 @@ func TestCreateExternalLoadBalancer(t *testing.T) {
}{
{
service: &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "no-external-balancer",
Namespace: "default",
},
@@ -54,7 +55,7 @@ func TestCreateExternalLoadBalancer(t *testing.T) {
},
{
service: &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "udp-service",
Namespace: "default",
SelfLink: testapi.Default.SelfLink("services", "udp-service"),
@@ -72,7 +73,7 @@ func TestCreateExternalLoadBalancer(t *testing.T) {
},
{
service: &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "basic-service1",
Namespace: "default",
SelfLink: testapi.Default.SelfLink("services", "basic-service1"),
@@ -146,9 +147,9 @@ func TestCreateExternalLoadBalancer(t *testing.T) {
// TODO: Finish converting and update comments
func TestUpdateNodesInExternalLoadBalancer(t *testing.T) {
nodes := []*v1.Node{
{ObjectMeta: v1.ObjectMeta{Name: "node0"}},
{ObjectMeta: v1.ObjectMeta{Name: "node1"}},
{ObjectMeta: v1.ObjectMeta{Name: "node73"}},
{ObjectMeta: metav1.ObjectMeta{Name: "node0"}},
{ObjectMeta: metav1.ObjectMeta{Name: "node1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "node73"}},
}
table := []struct {
services []*v1.Service