From 6287a5585223e5934706d1c1c21d68bfac5b5803 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 15 May 2020 09:33:21 -0700 Subject: V2 Implement terminal handling in bindings attach * Add support for /exec/{id}/resize * Add support for ErrSessionNotFound * Resize container TTY as stdin changes size * Refactor all resize functions into one handler Signed-off-by: Jhon Honce --- pkg/api/handlers/utils/errors.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/api/handlers/utils/errors.go') diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go index 3253a9be3..c17720694 100644 --- a/pkg/api/handlers/utils/errors.go +++ b/pkg/api/handlers/utils/errors.go @@ -63,6 +63,14 @@ func PodNotFound(w http.ResponseWriter, name string, err error) { Error(w, msg, http.StatusNotFound, err) } +func SessionNotFound(w http.ResponseWriter, name string, err error) { + if errors.Cause(err) != define.ErrNoSuchExecSession { + InternalServerError(w, err) + } + msg := fmt.Sprintf("No such exec session: %s", name) + Error(w, msg, http.StatusNotFound, err) +} + func ContainerNotRunning(w http.ResponseWriter, containerID string, err error) { msg := fmt.Sprintf("Container %s is not running", containerID) Error(w, msg, http.StatusConflict, err) -- cgit v1.2.3-54-g00ecf