server: Lookup infra containers as well in endpoint
@@ -48,10 +48,13 @@ func (s *Server) StartInfoEndpoints() error {
mux.Get("/containers/:id", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
containerID := bone.GetValue(req, "id")
ctr := s.GetContainer(containerID)
+ if ctr == nil {
+ ctr = s.getInfraContainer(containerID)
if ctr == nil {
http.Error(w, fmt.Sprintf("container with id: %s not found", containerID), http.StatusNotFound)
return
}
+ }
ctrState := ctr.State()
if ctrState == nil {
http.Error(w, fmt.Sprintf("container %s state is nil", containerID), http.StatusNotFound)
