Commit 3bcb501c authored by Janoš Guljaš's avatar Janoš Guljaš Committed by Balint Gabor

swarm/api: close tar writer in GetDirectoryTar to flush and clean (#17339)

parent d3e4c2dc
......@@ -525,6 +525,10 @@ func (a *API) GetDirectoryTar(ctx context.Context, uri *URI) (io.ReadCloser, err
return nil
})
// close tar writer before closing pipew
// to flush remaining data to pipew
// regardless of error value
tw.Close()
if err != nil {
apiGetTarFail.Inc(1)
pipew.CloseWithError(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment