Revert "Add an api object for the kubelet, and a versioned endpoint."
This reverts commit d4b9979382
.
This commit is contained in:
@@ -28,11 +28,11 @@ type FakePodInfoGetter struct {
|
||||
host string
|
||||
id string
|
||||
namespace string
|
||||
data api.PodContainerInfo
|
||||
data api.PodInfo
|
||||
err error
|
||||
}
|
||||
|
||||
func (f *FakePodInfoGetter) GetPodInfo(host, namespace, id string) (api.PodContainerInfo, error) {
|
||||
func (f *FakePodInfoGetter) GetPodInfo(host, namespace, id string) (api.PodInfo, error) {
|
||||
f.host = host
|
||||
f.id = id
|
||||
f.namespace = namespace
|
||||
@@ -42,15 +42,11 @@ func (f *FakePodInfoGetter) GetPodInfo(host, namespace, id string) (api.PodConta
|
||||
func TestPodCacheGetDifferentNamespace(t *testing.T) {
|
||||
cache := NewPodCache(nil, nil)
|
||||
|
||||
expectedDefault := api.PodContainerInfo{
|
||||
ContainerInfo: api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
},
|
||||
expectedDefault := api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
}
|
||||
expectedOther := api.PodContainerInfo{
|
||||
ContainerInfo: api.PodInfo{
|
||||
"bar": api.ContainerStatus{},
|
||||
},
|
||||
expectedOther := api.PodInfo{
|
||||
"bar": api.ContainerStatus{},
|
||||
}
|
||||
|
||||
cache.podInfo[makePodCacheKey(api.NamespaceDefault, "foo")] = expectedDefault
|
||||
@@ -76,10 +72,8 @@ func TestPodCacheGetDifferentNamespace(t *testing.T) {
|
||||
func TestPodCacheGet(t *testing.T) {
|
||||
cache := NewPodCache(nil, nil)
|
||||
|
||||
expected := api.PodContainerInfo{
|
||||
ContainerInfo: api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
},
|
||||
expected := api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
}
|
||||
cache.podInfo[makePodCacheKey(api.NamespaceDefault, "foo")] = expected
|
||||
|
||||
@@ -99,16 +93,14 @@ func TestPodCacheGetMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Errorf("Unexpected non-error: %#v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(info, api.PodContainerInfo{}) {
|
||||
if info != nil {
|
||||
t.Errorf("Unexpected info: %#v", info)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPodGetPodInfoGetter(t *testing.T) {
|
||||
expected := api.PodContainerInfo{
|
||||
ContainerInfo: api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
},
|
||||
expected := api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
}
|
||||
fake := FakePodInfoGetter{
|
||||
data: expected,
|
||||
@@ -141,10 +133,8 @@ func TestPodUpdateAllContainers(t *testing.T) {
|
||||
pods := []api.Pod{pod}
|
||||
mockRegistry := registrytest.NewPodRegistry(&api.PodList{Items: pods})
|
||||
|
||||
expected := api.PodContainerInfo{
|
||||
ContainerInfo: api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
},
|
||||
expected := api.PodInfo{
|
||||
"foo": api.ContainerStatus{},
|
||||
}
|
||||
fake := FakePodInfoGetter{
|
||||
data: expected,
|
||||
|
Reference in New Issue
Block a user