Docker executor: return error on pull/import failures
What does this MR do?
Handles the event stream from docker's pull
and import
calls. DisplayJSONMessagesStream
handles the json stream and typically writes the output to an io.Writer. We discard most of the data just as before, but handle the error returned.
Why was this MR needed?
Errors such as gitlab#218331 (closed) are difficult to debug because the error message from pull/import isn't handled.
I think in another MR, we can extend handleEventStream
to be more useful (display progress at least in --debug
mode?). But for this MR, I'm thinking we just focus on useful error output.
Are there points in the code the reviewer needs to double check?
The previous implementation had a // TODO: respect the context here
comment. The context was already passed to the request, and if cancelled, closes the ReadCloser
aborting the copy. This cancellation will also cancel the pull/import for the docker daemon.
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Added tests for this feature/bug -
In case of conflicts with master
- branch was rebased
What are the relevant issue numbers?
Closes gitlab#218331 (closed)