Skip to content

Commit

Permalink
[remote] Don't close streaming layers ourselves (#768)
Browse files Browse the repository at this point in the history
* [remote] Don't close streaming layers ourselves

"The request Body, if non-nil, will be closed by the underlying
Transport, even on errors."

https://golang.org/pkg/net/http/#Client.Do

Fixes #707

* Fix modules
  • Loading branch information
jonjohnsonjr committed Sep 11, 2020
1 parent d42b6a2 commit d7f8d06
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
3 changes: 1 addition & 2 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pkg/v1/remote/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ func (w *writer) initiateUpload(from, mount string) (location string, mounted bo
// On failure, this will return an error. On success, this will return the location
// header indicating how to commit the streamed blob.
func (w *writer) streamBlob(blob io.ReadCloser, streamLocation string) (commitLocation string, err error) {
defer blob.Close()

req, err := http.NewRequest(http.MethodPatch, streamLocation, blob)
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ golang.org/x/text/unicode/norm
# golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1
## explicit
golang.org/x/time/rate
# golang.org/x/tools v0.0.0-20200910222312-571a207697e7
# golang.org/x/tools v0.0.0-20200911153331-7ad463ce66dd
## explicit
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/gcexportdata
Expand Down

0 comments on commit d7f8d06

Please sign in to comment.