From e2389a4061d04f1baacd88f1438fb21102232d66 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Thu, 30 Jul 2015 11:52:23 +0100 Subject: [PATCH] [proxy] Don't try to attach if container failed to start --- proxy/start_container_interceptor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxy/start_container_interceptor.go b/proxy/start_container_interceptor.go index 803ca869..9dc1411d 100644 --- a/proxy/start_container_interceptor.go +++ b/proxy/start_container_interceptor.go @@ -16,6 +16,10 @@ func (i *startContainerInterceptor) InterceptRequest(r *http.Request) error { } func (i *startContainerInterceptor) InterceptResponse(r *http.Response) error { + if r.StatusCode < 200 || r.StatusCode >= 300 { // Docker didn't do the start + return nil + } + container, err := inspectContainerInPath(i.proxy.client, r.Request.URL.Path) if err != nil { return err