diff options
author | Vladimir Kochnev <hashtable@yandex.ru> | 2022-08-17 03:07:01 +0300 |
---|---|---|
committer | Vladimir Kochnev <hashtable@yandex.ru> | 2022-08-18 23:48:43 +0300 |
commit | e48681e600e55718a9699006ac940738fa08f896 (patch) | |
tree | 7db176724b5e0e92ff1e85a3f2ff07d7cf8cdd34 /pkg/api/handlers/libpod/manifests.go | |
parent | b9fb60c68acb57e56edae0b35dd408f454d32be5 (diff) | |
download | podman-e48681e600e55718a9699006ac940738fa08f896.tar.gz podman-e48681e600e55718a9699006ac940738fa08f896.tar.bz2 podman-e48681e600e55718a9699006ac940738fa08f896.zip |
Use request Context() in API handlers
Request object has its own context which must be used during a request
lifetime instead of just context.Background()
[NO NEW TESTS NEEDED]
Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
Diffstat (limited to 'pkg/api/handlers/libpod/manifests.go')
-rw-r--r-- | pkg/api/handlers/libpod/manifests.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/manifests.go b/pkg/api/handlers/libpod/manifests.go index fa83bbfe1..8391def5c 100644 --- a/pkg/api/handlers/libpod/manifests.go +++ b/pkg/api/handlers/libpod/manifests.go @@ -293,7 +293,7 @@ func ManifestPushV3(w http.ResponseWriter, r *http.Request) { options.SkipTLSVerify = types.NewOptionalBool(!query.TLSVerify) } imageEngine := abi.ImageEngine{Libpod: runtime} - digest, err := imageEngine.ManifestPush(context.Background(), source, query.Destination, options) + digest, err := imageEngine.ManifestPush(r.Context(), source, query.Destination, options) if err != nil { utils.Error(w, http.StatusBadRequest, fmt.Errorf("error pushing image %q: %w", query.Destination, err)) return @@ -367,7 +367,7 @@ func ManifestPush(w http.ResponseWriter, r *http.Request) { // Let's keep thing simple when running in quiet mode and push directly. if query.Quiet { - digest, err := imageEngine.ManifestPush(context.Background(), source, destination, options) + digest, err := imageEngine.ManifestPush(r.Context(), source, destination, options) if err != nil { utils.Error(w, http.StatusBadRequest, fmt.Errorf("error pushing image %q: %w", destination, err)) return |