diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-12 02:07:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 02:07:36 -0400 |
commit | f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7 (patch) | |
tree | 215fcf8cac010819b632cc4c564025413b93728c /pkg/api/handlers/compat/images_build.go | |
parent | 72662f790bad0a3dc26a6a1498b6daa936702bb6 (diff) | |
parent | deaf9692432bb6a9353fe56cecb6cddf0401a78c (diff) | |
download | podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.gz podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.bz2 podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.zip |
Merge pull request #11517 from jwhonce/issues/10053
Refactor API server emphasis on logging
Diffstat (limited to 'pkg/api/handlers/compat/images_build.go')
-rw-r--r-- | pkg/api/handlers/compat/images_build.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 0fcca1821..6855742b2 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -20,6 +20,7 @@ import ( "github.com/containers/image/v5/types" "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/pkg/api/handlers/utils" + api "github.com/containers/podman/v3/pkg/api/types" "github.com/containers/podman/v3/pkg/auth" "github.com/containers/podman/v3/pkg/channel" "github.com/containers/storage/pkg/archive" @@ -128,7 +129,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Tag: []string{}, } - decoder := r.Context().Value("decoder").(*schema.Decoder) + decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder) if err := decoder.Decode(&query, r.URL.Query()); err != nil { utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, err) return @@ -410,7 +411,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { reporter := channel.NewWriter(make(chan []byte)) defer reporter.Close() - runtime := r.Context().Value("runtime").(*libpod.Runtime) + runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) rtc, err := runtime.GetConfig() if err != nil { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()")) @@ -520,7 +521,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { // Send headers and prime client for stream to come w.WriteHeader(http.StatusOK) - w.Header().Add("Content-Type", "application/json") + w.Header().Set("Content-Type", "application/json") flush() body := w.(io.Writer) |