Rename JSONBase -> TypeMeta in preparation for v1beta3

Will make subsequent refactor much easier
This commit is contained in:
Clayton Coleman
2014-10-07 11:12:16 -04:00
parent e294cef9d4
commit d3e51a0f24
69 changed files with 464 additions and 464 deletions

View File

@@ -265,7 +265,7 @@ func TestCreatePod(t *testing.T) {
func TestUpdatePod(t *testing.T) {
requestPod := &api.Pod{
JSONBase: api.JSONBase{ID: "foo", ResourceVersion: 1},
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: 1},
CurrentState: api.PodState{
Status: "Foobar",
},
@@ -289,7 +289,7 @@ func TestListControllers(t *testing.T) {
Body: &api.ReplicationControllerList{
Items: []api.ReplicationController{
{
JSONBase: api.JSONBase{ID: "foo"},
TypeMeta: api.TypeMeta{ID: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -313,7 +313,7 @@ func TestGetController(t *testing.T) {
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
JSONBase: api.JSONBase{ID: "foo"},
TypeMeta: api.TypeMeta{ID: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -330,14 +330,14 @@ func TestGetController(t *testing.T) {
func TestUpdateController(t *testing.T) {
requestController := &api.ReplicationController{
JSONBase: api.JSONBase{ID: "foo", ResourceVersion: 1},
TypeMeta: api.TypeMeta{ID: "foo", ResourceVersion: 1},
}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/replicationControllers/foo"},
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
JSONBase: api.JSONBase{ID: "foo"},
TypeMeta: api.TypeMeta{ID: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -363,14 +363,14 @@ func TestDeleteController(t *testing.T) {
func TestCreateController(t *testing.T) {
requestController := &api.ReplicationController{
JSONBase: api.JSONBase{ID: "foo"},
TypeMeta: api.TypeMeta{ID: "foo"},
}
c := &testClient{
Request: testRequest{Method: "POST", Path: "/replicationControllers", Body: requestController},
Response: Response{
StatusCode: 200,
Body: &api.ReplicationController{
JSONBase: api.JSONBase{ID: "foo"},
TypeMeta: api.TypeMeta{ID: "foo"},
DesiredState: api.ReplicationControllerState{
Replicas: 2,
},
@@ -401,7 +401,7 @@ func TestListServices(t *testing.T) {
Body: &api.ServiceList{
Items: []api.Service{
{
JSONBase: api.JSONBase{ID: "name"},
TypeMeta: api.TypeMeta{ID: "name"},
Labels: map[string]string{
"foo": "bar",
"name": "baz",
@@ -425,7 +425,7 @@ func TestListServicesLabels(t *testing.T) {
Body: &api.ServiceList{
Items: []api.Service{
{
JSONBase: api.JSONBase{ID: "name"},
TypeMeta: api.TypeMeta{ID: "name"},
Labels: map[string]string{
"foo": "bar",
"name": "baz",
@@ -448,7 +448,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{JSONBase: api.JSONBase{ID: "service-1"}}},
Response: Response{StatusCode: 200, Body: &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}}},
}
response, err := c.Setup().GetService(api.NewDefaultContext(), "1")
c.Validate(t, response, err)
@@ -456,15 +456,15 @@ func TestGetService(t *testing.T) {
func TestCreateService(t *testing.T) {
c := &testClient{
Request: testRequest{Method: "POST", Path: "/services", Body: &api.Service{JSONBase: api.JSONBase{ID: "service-1"}}},
Response: Response{StatusCode: 200, Body: &api.Service{JSONBase: api.JSONBase{ID: "service-1"}}},
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"}}},
}
response, err := c.Setup().CreateService(api.NewDefaultContext(), &api.Service{JSONBase: api.JSONBase{ID: "service-1"}})
response, err := c.Setup().CreateService(api.NewDefaultContext(), &api.Service{TypeMeta: api.TypeMeta{ID: "service-1"}})
c.Validate(t, response, err)
}
func TestUpdateService(t *testing.T) {
svc := &api.Service{JSONBase: api.JSONBase{ID: "service-1", ResourceVersion: 1}}
svc := &api.Service{TypeMeta: api.TypeMeta{ID: "service-1", ResourceVersion: 1}}
c := &testClient{
Request: testRequest{Method: "PUT", Path: "/services/service-1", Body: svc},
Response: Response{StatusCode: 200, Body: svc},
@@ -489,7 +489,7 @@ func TestListEndpooints(t *testing.T) {
Body: &api.EndpointsList{
Items: []api.Endpoints{
{
JSONBase: api.JSONBase{ID: "endpoint-1"},
TypeMeta: api.TypeMeta{ID: "endpoint-1"},
Endpoints: []string{"10.245.1.2:8080", "10.245.1.3:8080"},
},
},
@@ -503,7 +503,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{JSONBase: api.JSONBase{ID: "endpoint-1"}}},
Response: Response{StatusCode: 200, Body: &api.Endpoints{TypeMeta: api.TypeMeta{ID: "endpoint-1"}}},
}
response, err := c.Setup().GetEndpoints(api.NewDefaultContext(), "endpoint-1")
c.Validate(t, response, err)
@@ -539,7 +539,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{JSONBase: api.JSONBase{ID: "minion-1"}}},
Response: Response{StatusCode: 200, Body: &api.MinionList{TypeMeta: api.TypeMeta{ID: "minion-1"}}},
}
response, err := c.Setup().ListMinions()
c.Validate(t, response, err)