mirror of https://github.com/portainer/portainer
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
|
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(
|
handlerErr := handler.hijackPodExecStartOperation(
|
||||||
w,
|
w,
|
||||||
r,
|
r,
|
||||||
cli,
|
cli,
|
||||||
serviceAccountToken,
|
"",
|
||||||
isAdminToken,
|
true,
|
||||||
endpoint,
|
endpoint,
|
||||||
shellPod.Namespace,
|
shellPod.Namespace,
|
||||||
shellPod.PodName,
|
shellPod.PodName,
|
||||||
|
|
Loading…
Reference in New Issue