[proxy] print all stderr from callWeave to the proxy logs, even if successful

This commit is contained in:
Paul Bellamy committed 2015-07-03 15:45:09 +01:00
1 parent fcea6fcbf8
commit 7821412bf7
3 files changed
+13 -8

No files matched your search

+5 -3
View File
@@ -30,9 +30,11 @@ func (i *startContainerInterceptor) InterceptResponse(r *http.Response) error {
args := []string{"attach"}
args = append(args, cidrs...)
args = append(args, "--or-die", container.ID)
if output, err := callWeave(args...); err != nil {
Log.Warningf("Attaching container %s to weave network failed: %s", container.ID, string(output))
return errors.New(string(output))
if _, stderr, err := callWeave(args...); err != nil {
Log.Warningf("Attaching container %s to weave network failed: %s", container.ID, string(stderr))
return errors.New(string(stderr))
} else if len(stderr) > 0 {
Log.Warningf("Attaching container %s to weave network: %s", container.ID, string(stderr))
}
return i.proxy.client.KillContainer(docker.KillContainerOptions{ID: container.ID, Signal: docker.SIGUSR2})