mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
Changed PodInfo to be a list
This change is to make API consistent with our convention. Fixes #3622
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user