diff options
author | Brent Baude <bbaude@redhat.com> | 2020-01-30 12:40:19 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-01-31 08:38:25 -0600 |
commit | f1eaccedfa08455d699d00dcda63b95aeb34833e (patch) | |
tree | 65d385fd683a66686b225827c760e5bc95f7e346 /pkg/api/handlers/libpod/pods.go | |
parent | 36af2833f954e1c822b917ecff45c05858188c2d (diff) | |
download | podman-f1eaccedfa08455d699d00dcda63b95aeb34833e.tar.gz podman-f1eaccedfa08455d699d00dcda63b95aeb34833e.tar.bz2 podman-f1eaccedfa08455d699d00dcda63b95aeb34833e.zip |
fix longname handling for bindings
the api needs to account for image input where the image is encoded as a fqd image name.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod/pods.go')
-rw-r--r-- | pkg/api/handlers/libpod/pods.go | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index 50d763338..091368985 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -19,8 +19,6 @@ import ( ) func PodCreate(w http.ResponseWriter, r *http.Request) { - // 200 ok - // 500 internal var ( runtime = r.Context().Value("runtime").(*libpod.Runtime) options []libpod.PodCreateOption @@ -141,7 +139,7 @@ func Pods(w http.ResponseWriter, r *http.Request) { func PodInspect(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -156,10 +154,6 @@ func PodInspect(w http.ResponseWriter, r *http.Request) { } func PodStop(w http.ResponseWriter, r *http.Request) { - // 200 - // 304 not modified - // 404 no such - // 500 internal var ( stopError error runtime = r.Context().Value("runtime").(*libpod.Runtime) @@ -177,7 +171,7 @@ func PodStop(w http.ResponseWriter, r *http.Request) { return } allContainersStopped := true - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -224,7 +218,7 @@ func PodStop(w http.ResponseWriter, r *http.Request) { func PodStart(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) allContainersRunning := true - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -278,7 +272,7 @@ func PodDelete(w http.ResponseWriter, r *http.Request) { errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String())) return } - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -293,7 +287,7 @@ func PodDelete(w http.ResponseWriter, r *http.Request) { func PodRestart(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -321,7 +315,7 @@ func PodPrune(w http.ResponseWriter, r *http.Request) { func PodPause(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -336,11 +330,8 @@ func PodPause(w http.ResponseWriter, r *http.Request) { } func PodUnpause(w http.ResponseWriter, r *http.Request) { - // 200 ok - // 404 no such - // 500 internal runtime := r.Context().Value("runtime").(*libpod.Runtime) - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -379,7 +370,7 @@ func PodKill(w http.ResponseWriter, r *http.Request) { if err != nil { utils.InternalServerError(w, errors.Wrapf(err, "unable to parse signal value")) } - name := mux.Vars(r)["name"] + name := utils.GetName(r) pod, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) @@ -412,7 +403,7 @@ func PodKill(w http.ResponseWriter, r *http.Request) { func PodExists(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) - name := mux.Vars(r)["name"] + name := utils.GetName(r) _, err := runtime.LookupPod(name) if err != nil { utils.PodNotFound(w, name, err) |