Merge pull request #5712 from coryb/docker-push-close-body
Fix missing Body.Close() calls on push to docker remote
This commit is contained in:
commit
b6aa5a48bd
@ -190,6 +190,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
switch resp.StatusCode {
|
switch resp.StatusCode {
|
||||||
case http.StatusOK, http.StatusAccepted, http.StatusNoContent:
|
case http.StatusOK, http.StatusAccepted, http.StatusNoContent:
|
||||||
@ -382,6 +383,7 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di
|
|||||||
if resp.err != nil {
|
if resp.err != nil {
|
||||||
return resp.err
|
return resp.err
|
||||||
}
|
}
|
||||||
|
defer resp.Response.Body.Close()
|
||||||
|
|
||||||
// 201 is specified return status, some registries return
|
// 201 is specified return status, some registries return
|
||||||
// 200, 202 or 204.
|
// 200, 202 or 204.
|
||||||
|
Loading…
Reference in New Issue
Block a user