fix(kubectl): EE-1342 non-admin users cannot connect to the local kube cluster using kubectl shell (#5475)
Co-authored-by: Simon Meng <simon.meng@portainer.io>pull/5506/head
parent
ab30793c48
commit
d6e291db15
|
@ -86,17 +86,12 @@ func (handler *Handler) websocketShellPodExec(w http.ResponseWriter, r *http.Req
|
|||
return nil
|
||||
}
|
||||
|
||||
serviceAccountToken, isAdminToken, err := handler.getToken(r, endpoint, false)
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to get user service account token", err}
|
||||
}
|
||||
|
||||
handlerErr := handler.hijackPodExecStartOperation(
|
||||
w,
|
||||
r,
|
||||
cli,
|
||||
serviceAccountToken,
|
||||
isAdminToken,
|
||||
"",
|
||||
true,
|
||||
endpoint,
|
||||
shellPod.Namespace,
|
||||
shellPod.PodName,
|
||||
|
|
Loading…
Reference in New Issue