diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-02 20:23:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 20:23:26 +0100 |
commit | 47c4ea39196cedac87e7a4e4c1ead54ed9d7ed50 (patch) | |
tree | 64ce3ceb630aaecf993b1747bf8ba7f3f3af170f /pkg/api/handlers/images_build.go | |
parent | f9a476833bc8461dd246db0b31f542ad4a6d7587 (diff) | |
parent | 09048731000e73b44a0243a0339d8c122eb8a165 (diff) | |
download | podman-47c4ea39196cedac87e7a4e4c1ead54ed9d7ed50.tar.gz podman-47c4ea39196cedac87e7a4e4c1ead54ed9d7ed50.tar.bz2 podman-47c4ea39196cedac87e7a4e4c1ead54ed9d7ed50.zip |
Merge pull request #5347 from baude/apiv2wait
rework apiv2 wait endpoint|binding
Diffstat (limited to 'pkg/api/handlers/images_build.go')
-rw-r--r-- | pkg/api/handlers/images_build.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pkg/api/handlers/images_build.go b/pkg/api/handlers/images_build.go index b29c45574..d969e3a47 100644 --- a/pkg/api/handlers/images_build.go +++ b/pkg/api/handlers/images_build.go @@ -17,7 +17,6 @@ import ( "github.com/containers/buildah/imagebuildah" "github.com/containers/libpod/pkg/api/handlers/utils" "github.com/containers/storage/pkg/archive" - "github.com/gorilla/mux" ) func BuildImage(w http.ResponseWriter, r *http.Request) { @@ -114,24 +113,24 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { tag = tokens[1] } - if t, found := mux.Vars(r)["target"]; found { - name = t + if _, found := r.URL.Query()["target"]; found { + name = query.Target } var buildArgs = map[string]string{} - if a, found := mux.Vars(r)["buildargs"]; found { - if err := json.Unmarshal([]byte(a), &buildArgs); err != nil { - utils.BadRequest(w, "buildargs", a, err) + if _, found := r.URL.Query()["buildargs"]; found { + if err := json.Unmarshal([]byte(query.BuildArgs), &buildArgs); err != nil { + utils.BadRequest(w, "buildargs", query.BuildArgs, err) return } } // convert label formats var labels = []string{} - if l, found := mux.Vars(r)["labels"]; found { + if _, found := r.URL.Query()["labels"]; found { var m = map[string]string{} - if err := json.Unmarshal([]byte(l), &m); err != nil { - utils.BadRequest(w, "labels", l, err) + if err := json.Unmarshal([]byte(query.Labels), &m); err != nil { + utils.BadRequest(w, "labels", query.Labels, err) return } @@ -141,7 +140,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } pullPolicy := buildah.PullIfMissing - if _, found := mux.Vars(r)["pull"]; found { + if _, found := r.URL.Query()["pull"]; found { if query.Pull { pullPolicy = buildah.PullAlways } |