Skip to content

Commit

Permalink
Fix the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Sep 18, 2014
1 parent 12b677a commit edf3eb0
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions pkg/registry/pod/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edf3eb0

Please sign in to comment.