mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-11-03 09:37:34 +00:00
remote pull: cancel pull when connection is closed
If a client closes the http connection during image pull, the service should cancel the pull operation. [NO TESTS NEEDED] I have no idea how we could test this reliable. Fixes: #7558 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
2993bdf1ef
commit
c28f442b28
1 changed files with 1 additions and 1 deletions
|
|
@ -85,7 +85,7 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
var pulledImages []*libimage.Image
|
||||
var pullError error
|
||||
runCtx, cancel := context.WithCancel(context.Background())
|
||||
runCtx, cancel := context.WithCancel(r.Context())
|
||||
go func() {
|
||||
defer cancel()
|
||||
pulledImages, pullError = runtime.LibimageRuntime().Pull(runCtx, query.Reference, config.PullPolicyAlways, pullOptions)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue