Changed PodInfo to be a list

This change is to make API consistent with our convention.

Fixes #3622
This commit is contained in:
Piotr Szczesniak
2015-03-25 12:09:35 +01:00
parent 8183a4805e
commit 31901ed9d0
14 changed files with 392 additions and 185 deletions

View File

@@ -33,9 +33,9 @@ import (
func TestHTTPKubeletClient(t *testing.T) {
expectObj := api.PodStatusResult{
Status: api.PodStatus{
Info: map[string]api.ContainerStatus{
"myID1": {},
"myID2": {},
ContainerStatuses: []api.ContainerStatus{
{Name: "myID1"},
{Name: "myID2"},
},
},
}
@@ -73,15 +73,17 @@ func TestHTTPKubeletClient(t *testing.T) {
}
// reflect.DeepEqual(expectObj, gotObj) doesn't handle blank times well
if len(gotObj.Status.Info) != len(expectObj.Status.Info) {
if len(gotObj.Status.ContainerStatuses) != len(expectObj.Status.ContainerStatuses) {
t.Errorf("Unexpected response. Expected: %#v, received %#v", expectObj, gotObj)
}
}
func TestHTTPKubeletClientNotFound(t *testing.T) {
expectObj := api.PodContainerInfo{
ContainerInfo: map[string]api.ContainerStatus{
"myID": {},
ContainerInfo: []api.ContainerStatus{
{
Name: "myID",
},
},
}
_, err := json.Marshal(expectObj)
@@ -120,8 +122,10 @@ func TestHTTPKubeletClientNotFound(t *testing.T) {
func TestHTTPKubeletClientError(t *testing.T) {
expectObj := api.PodContainerInfo{
ContainerInfo: map[string]api.ContainerStatus{
"myID": {},
ContainerInfo: []api.ContainerStatus{
{
Name: "myID",
},
},
}
_, err := json.Marshal(expectObj)