Rename ID -> Name

This commit is contained in:
Clayton Coleman
2014-10-22 13:02:02 -04:00
parent bdebff5b28
commit bb77a5d15f
107 changed files with 777 additions and 777 deletions

View File

@@ -266,7 +266,7 @@ func TestCreatePod(t *testing.T) {
func TestUpdatePod(t *testing.T) {
requestPod := &api.Pod{
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: "1"},
TypeMeta: api.TypeMeta{Name: "foo", ResourceVersion: "1"},
CurrentState: api.PodState{
Status: "Foobar",
},
@@ -290,7 +290,7 @@ func TestListControllers(t *testing.T) {
Body: &api.ReplicationControllerList{
Items: []api.ReplicationController{
{
TypeMeta: api.TypeMeta{ID: "foo"},
TypeMeta: api.TypeMeta{Name: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -314,7 +314,7 @@ func TestGetController(t *testing.T) {
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo"},
TypeMeta: api.TypeMeta{Name: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -331,14 +331,14 @@ func TestGetController(t *testing.T) {
func TestUpdateController(t *testing.T) {
requestController := &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: "1"},
TypeMeta: api.TypeMeta{Name: "foo", ResourceVersion: "1"},
}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/replicationControllers/foo"},
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo"},
TypeMeta: api.TypeMeta{Name: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -364,14 +364,14 @@ func TestDeleteController(t *testing.T) {
func TestCreateController(t *testing.T) {
requestController := &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo"},
TypeMeta: api.TypeMeta{Name: "foo"},
}
c := &testClient{
Request: testRequest{Method: "POST", Path: "/replicationControllers", Body: requestController},
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
TypeMeta: api.TypeMeta{ID: "foo"},
TypeMeta: api.TypeMeta{Name: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -402,7 +402,7 @@ func TestListServices(t *testing.T) {
Body: &api.ServiceList{
Items: []api.Service{
{
TypeMeta: api.TypeMeta{ID: "name"},
TypeMeta: api.TypeMeta{Name: "name"},
Labels: map[string]string{
"foo": "bar",
"name": "baz",
@@ -426,7 +426,7 @@ func TestListServicesLabels(t *testing.T) {
Body: &api.ServiceList{
Items: []api.Service{
{
TypeMeta: api.TypeMeta{ID: "name"},
TypeMeta: api.TypeMeta{Name: "name"},
Labels: map[string]string{
"foo": "bar",
"name": "baz",
@@ -449,7 +449,7 @@ func TestListServicesLabels(t *testing.T) {
func TestGetService(t *testing.T) {
c := &testClient{
Request: testRequest{Method: "GET", Path: "/services/1"},
Response: Response{StatusCode: 200, Body: &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}}},
Response: Response{StatusCode: 200, Body: &api.Service{TypeMeta: api.TypeMeta{Name: "service-1"}}},
}
response, err := c.Setup().GetService(api.NewDefaultContext(), "1")
c.Validate(t, response, err)
@@ -457,15 +457,15 @@ func TestGetService(t *testing.T) {
func TestCreateService(t *testing.T) {
c := &testClient{
Request: testRequest{Method: "POST", Path: "/services", Body: &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}}},
Response: Response{StatusCode: 200, Body: &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}}},
Request: testRequest{Method: "POST", Path: "/services", Body: &api.Service{TypeMeta: api.TypeMeta{Name: "service-1"}}},
Response: Response{StatusCode: 200, Body: &api.Service{TypeMeta: api.TypeMeta{Name: "service-1"}}},
}
response, err := c.Setup().CreateService(api.NewDefaultContext(), &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}})
response, err := c.Setup().CreateService(api.NewDefaultContext(), &api.Service{TypeMeta: api.TypeMeta{Name: "service-1"}})
c.Validate(t, response, err)
}
func TestUpdateService(t *testing.T) {
svc := &api.Service{TypeMeta: api.TypeMeta{ID: "service-1", ResourceVersion: "1"}}
svc := &api.Service{TypeMeta: api.TypeMeta{Name: "service-1", ResourceVersion: "1"}}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/services/service-1", Body: svc},
Response: Response{StatusCode: 200, Body: svc},
@@ -490,7 +490,7 @@ func TestListEndpooints(t *testing.T) {
Body: &api.EndpointsList{
Items: []api.Endpoints{
{
TypeMeta: api.TypeMeta{ID: "endpoint-1"},
TypeMeta: api.TypeMeta{Name: "endpoint-1"},
Endpoints: []string{"10.245.1.2:8080", "10.245.1.3:8080"},
},
},
@@ -504,7 +504,7 @@ func TestListEndpooints(t *testing.T) {
func TestGetEndpoints(t *testing.T) {
c := &testClient{
Request: testRequest{Method: "GET", Path: "/endpoints/endpoint-1"},
Response: Response{StatusCode: 200, Body: &api.Endpoints{TypeMeta: api.TypeMeta{ID: "endpoint-1"}}},
Response: Response{StatusCode: 200, Body: &api.Endpoints{TypeMeta: api.TypeMeta{Name: "endpoint-1"}}},
}
response, err := c.Setup().GetEndpoints(api.NewDefaultContext(), "endpoint-1")
c.Validate(t, response, err)
@@ -540,7 +540,7 @@ func TestGetServerVersion(t *testing.T) {
func TestListMinions(t *testing.T) {
c := &testClient{
Request: testRequest{Method: "GET", Path: "/minions"},
Response: Response{StatusCode: 200, Body: &api.MinionList{TypeMeta: api.TypeMeta{ID: "minion-1"}}},
Response: Response{StatusCode: 200, Body: &api.MinionList{TypeMeta: api.TypeMeta{Name: "minion-1"}}},
}
response, err := c.Setup().ListMinions()
c.Validate(t, response, err)
@@ -549,7 +549,7 @@ func TestListMinions(t *testing.T) {
func TestCreateMinion(t *testing.T) {
requestMinion := &api.Minion{
TypeMeta: api.TypeMeta{
ID: "minion-1",
Name: "minion-1",
},
HostIP: "123.321.456.654",
NodeResources: api.NodeResources{