From edf3eb04e2b0c45b06d361f00ec12edda9af461d Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Thu, 18 Sep 2014 15:29:17 -0700 Subject: [PATCH] Fix the build. --- pkg/registry/pod/rest.go | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pkg/registry/pod/rest.go b/pkg/registry/pod/rest.go index a80f61f9a8b..efd85ec47d7 100644 --- a/pkg/registry/pod/rest.go +++ b/pkg/registry/pod/rest.go @@ -227,20 +227,24 @@ func getPodStatus(pod *api.Pod, minions client.MinionInterface) (api.PodStatus, if pod.CurrentState.Host == "" { return api.PodWaiting, nil } - res, err := minions.ListMinions() - if err != nil { - glog.Errorf("Error listing minions: %v", err) - return "", err - } - found := false - for _, minion := range res.Items { - if minion.ID == pod.CurrentState.Host { - found = true - break + if minions != nil { + res, err := minions.ListMinions() + if err != nil { + glog.Errorf("Error listing minions: %v", err) + return "", err } - } - if !found { - return api.PodTerminated, nil + found := false + for _, minion := range res.Items { + if minion.ID == pod.CurrentState.Host { + found = true + break + } + } + if !found { + return api.PodTerminated, nil + } + } else { + glog.Errorf("Unexpected missing minion interface, status may be in-accurate") } if pod.CurrentState.Info == nil { return api.PodWaiting, nil