diff --git a/pkg/kubelet/server.go b/pkg/kubelet/server.go index f8c7545cce..75b05fc547 100644 --- a/pkg/kubelet/server.go +++ b/pkg/kubelet/server.go @@ -318,9 +318,11 @@ func (s *Server) serveStats(w http.ResponseWriter, req *http.Request) { errors.New("pod level status currently unimplemented") case 3: // Backward compatibility without uuid information - stats, err = s.host.GetContainerInfo(components[1], "", components[2], &query) + podFullName := GetPodFullName(&Pod{Name: components[1], Namespace: "etcd"}) + stats, err = s.host.GetContainerInfo(podFullName, "", components[2], &query) case 4: - stats, err = s.host.GetContainerInfo(components[1], components[2], components[2], &query) + podFullName := GetPodFullName(&Pod{Name: components[1], Namespace: "etcd"}) + stats, err = s.host.GetContainerInfo(podFullName, components[2], components[2], &query) default: http.Error(w, "unknown resource.", http.StatusNotFound) return diff --git a/pkg/kubelet/server_test.go b/pkg/kubelet/server_test.go index 4a6aa2fd24..be9f3c5d4b 100644 --- a/pkg/kubelet/server_test.go +++ b/pkg/kubelet/server_test.go @@ -174,7 +174,8 @@ func TestPodInfo(t *testing.T) { func TestContainerInfo(t *testing.T) { fw := newServerTest() expectedInfo := &info.ContainerInfo{} - expectedPodID := "somepod" + podID := "somepod" + expectedPodID := "somepod" + ".etcd" expectedContainerName := "goodcontainer" fw.fakeKubelet.containerInfoFunc = func(podID, containerName string, req *info.ContainerInfoRequest) (*info.ContainerInfo, error) { if podID != expectedPodID || containerName != expectedContainerName { @@ -183,7 +184,7 @@ func TestContainerInfo(t *testing.T) { return expectedInfo, nil } - resp, err := http.Get(fw.testHTTPServer.URL + fmt.Sprintf("/stats/%v/%v", expectedPodID, expectedContainerName)) + resp, err := http.Get(fw.testHTTPServer.URL + fmt.Sprintf("/stats/%v/%v", podID, expectedContainerName)) if err != nil { t.Fatalf("Got error GETing: %v", err) }