server: Lookup infra containers as well in endpoint

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2017-09-01 08:50:17 -07:00
parent 138a40540f
commit e9378f23ca

View file

@ -49,8 +49,11 @@ func (s *Server) StartInfoEndpoints() error {
containerID := bone.GetValue(req, "id") containerID := bone.GetValue(req, "id")
ctr := s.GetContainer(containerID) ctr := s.GetContainer(containerID)
if ctr == nil { if ctr == nil {
http.Error(w, fmt.Sprintf("container with id: %s not found", containerID), http.StatusNotFound) ctr = s.getInfraContainer(containerID)
return if ctr == nil {
http.Error(w, fmt.Sprintf("container with id: %s not found", containerID), http.StatusNotFound)
return
}
} }
ctrState := ctr.State() ctrState := ctr.State()
if ctrState == nil { if ctrState == nil {