Merge pull request #1696 from derekwaynecarr/pod_cache_needs_namespace

Pod cache needs to be namespace-aware
This commit is contained in:
Brendan Burns
2014-10-10 08:28:32 -07:00
7 changed files with 74 additions and 36 deletions

View File

@@ -208,13 +208,13 @@ func (rs *REST) fillPodInfo(pod *api.Pod) {
// Get cached info for the list currently.
// TODO: Optionally use fresh info
if rs.podCache != nil {
info, err := rs.podCache.GetPodInfo(pod.CurrentState.Host, pod.ID)
info, err := rs.podCache.GetPodInfo(pod.CurrentState.Host, pod.Namespace, pod.ID)
if err != nil {
if err != client.ErrPodInfoNotAvailable {
glog.Errorf("Error getting container info from cache: %#v", err)
}
if rs.podInfoGetter != nil {
info, err = rs.podInfoGetter.GetPodInfo(pod.CurrentState.Host, pod.ID)
info, err = rs.podInfoGetter.GetPodInfo(pod.CurrentState.Host, pod.Namespace, pod.ID)
}
if err != nil {
if err != client.ErrPodInfoNotAvailable {

View File

@@ -597,7 +597,7 @@ type FakePodInfoGetter struct {
err error
}
func (f *FakePodInfoGetter) GetPodInfo(host, podID string) (api.PodInfo, error) {
func (f *FakePodInfoGetter) GetPodInfo(host, podNamespace string, podID string) (api.PodInfo, error) {
return f.info, f.err
}