From 76b3b5431475709b27f0c113f9319321388a49d1 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Sun, 20 Sep 2015 15:32:47 +0200 Subject: [PATCH] api: server: container: fix wrong comment This comment was wrongly referring to the old job mechanism and it wasn't clear what it was trying to document. Signed-off-by: Antonio Murdaca --- api/server/container.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/server/container.go b/api/server/container.go index f74ae89356..15817e0089 100644 --- a/api/server/container.go +++ b/api/server/container.go @@ -94,7 +94,11 @@ func (s *Server) getContainersLogs(ctx context.Context, w http.ResponseWriter, r return fmt.Errorf("Missing parameter") } - // Validate args here, because we can't return not StatusOK after job.Run() call + // Args are validated before the stream starts because when it starts we're + // sending HTTP 200 by writing an empty chunk of data to tell the client that + // daemon is going to stream. By sending this initial HTTP 200 we can't report + // any error after the stream starts (i.e. container not found, wrong parameters) + // with the appropriate status code. stdout, stderr := boolValue(r, "stdout"), boolValue(r, "stderr") if !(stdout || stderr) { return fmt.Errorf("Bad parameters: you must choose at least one stream")