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/generic/containers.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/generic/containers.go')
-rw-r--r-- | pkg/api/handlers/generic/containers.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/api/handlers/generic/containers.go b/pkg/api/handlers/generic/containers.go index b16b87e73..ab587ded4 100644 --- a/pkg/api/handlers/generic/containers.go +++ b/pkg/api/handlers/generic/containers.go @@ -14,7 +14,6 @@ import ( "github.com/containers/libpod/pkg/api/handlers" "github.com/containers/libpod/pkg/api/handlers/utils" "github.com/containers/libpod/pkg/util" - "github.com/gorilla/mux" "github.com/gorilla/schema" "github.com/pkg/errors" log "github.com/sirupsen/logrus" @@ -71,7 +70,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) return } - if _, found := mux.Vars(r)["limit"]; found { + if _, found := r.URL.Query()["limit"]; found { last := query.Limit if len(containers) > last { containers = containers[len(containers)-last:] @@ -136,7 +135,7 @@ func WaitContainer(w http.ResponseWriter, r *http.Request) { // /{version}/containers/(name)/wait exitCode, err := utils.WaitContainer(w, r) if err != nil { - msg = err.Error() + return } utils.WriteResponse(w, http.StatusOK, handlers.ContainerWaitOKBody{ StatusCode: int(exitCode), @@ -191,7 +190,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) { } var since time.Time - if _, found := mux.Vars(r)["since"]; found { + if _, found := r.URL.Query()["since"]; found { since, err = util.ParseInputTime(query.Since) if err != nil { utils.BadRequest(w, "since", query.Since, err) @@ -200,7 +199,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) { } var until time.Time - if _, found := mux.Vars(r)["until"]; found { + if _, found := r.URL.Query()["until"]; found { since, err = util.ParseInputTime(query.Until) if err != nil { utils.BadRequest(w, "until", query.Until, err) @@ -233,7 +232,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) { var builder strings.Builder for ok := true; ok; ok = query.Follow { for line := range logChannel { - if _, found := mux.Vars(r)["until"]; found { + if _, found := r.URL.Query()["until"]; found { if line.Time.After(until) { break } |