Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

close s3 reader after saving snapshot #1976

Merged
merged 1 commit into from
Jul 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/backup/writer/s3_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func (s3w *s3Writer) Write(ctx context.Context, path string, r io.Reader) (int64
if err != nil {
return 0, err
}
if resp.Body != nil {
defer resp.Body.Close()
}
if resp.ContentLength == nil {
return 0, fmt.Errorf("failed to compute s3 object size")
}
Expand Down