diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-05-15 14:43:26 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-05-15 15:02:41 -0400 |
commit | 6d1e5c713a3a62ba671c6966af23dc86ed2270dd (patch) | |
tree | 6367835f3c776d8ec2baa32b37f0ef4898a60e5f /pkg/api/handlers/compat | |
parent | ab25f70dad01018df1e6532180147cb6b353c31c (diff) | |
download | podman-6d1e5c713a3a62ba671c6966af23dc86ed2270dd.tar.gz podman-6d1e5c713a3a62ba671c6966af23dc86ed2270dd.tar.bz2 podman-6d1e5c713a3a62ba671c6966af23dc86ed2270dd.zip |
Drop APIv2 resize endpoint
Jhon is working on an alternative version that will combine
container and exec session resize, so we'll wait for that.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r-- | pkg/api/handlers/compat/exec.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/pkg/api/handlers/compat/exec.go b/pkg/api/handlers/compat/exec.go index 6ff9f607a..6865a3319 100644 --- a/pkg/api/handlers/compat/exec.go +++ b/pkg/api/handlers/compat/exec.go @@ -11,10 +11,8 @@ import ( "github.com/containers/libpod/pkg/api/handlers" "github.com/containers/libpod/pkg/api/handlers/utils" "github.com/gorilla/mux" - "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "k8s.io/client-go/tools/remotecommand" ) // ExecCreateHandler creates an exec session for a given container. @@ -117,45 +115,6 @@ func ExecInspectHandler(w http.ResponseWriter, r *http.Request) { } } -// ExecResizeHandler resizes a given exec session's TTY. -func ExecResizeHandler(w http.ResponseWriter, r *http.Request) { - runtime := r.Context().Value("runtime").(*libpod.Runtime) - decoder := r.Context().Value("decoder").(*schema.Decoder) - - sessionID := mux.Vars(r)["id"] - - query := struct { - Height uint16 `schema:"h"` - Width uint16 `schema:"w"` - }{ - // override any golang type defaults - } - if err := decoder.Decode(&query, r.URL.Query()); err != nil { - utils.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, - errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String())) - return - } - - sessionCtr, err := runtime.GetExecSessionContainer(sessionID) - if err != nil { - utils.Error(w, fmt.Sprintf("No such exec session: %s", sessionID), http.StatusNotFound, err) - return - } - - newSize := remotecommand.TerminalSize{ - Width: query.Width, - Height: query.Height, - } - - if err := sessionCtr.ExecResize(sessionID, newSize); err != nil { - utils.InternalServerError(w, err) - return - } - - // This is a 201 some reason, not a 204. - utils.WriteResponse(w, http.StatusCreated, "") -} - // ExecStartHandler runs a given exec session. func ExecStartHandler(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) |