Update pkg/kapis/terminal/v1alpha2/handler.go

Co-authored-by: hongming <coder.scala@gmail.com>
This commit is contained in:
lynxcat
2022-01-10 15:34:04 +08:00
committed by GitHub
parent 6ef7010533
commit 5e5c9a8d04

View File

@@ -95,14 +95,13 @@ func (t *terminalHandler) handleShellAccessToNode(request *restful.Request, resp
user, _ := requestctx.UserFrom(request.Request.Context())
createPodsExec := authorizer.AttributesRecord{
createNodesExec := authorizer.AttributesRecord{
User: user,
Verb: "create",
Resource: "pods",
Resource: "nodes",
Subresource: "exec",
Namespace: "kubesphere-controls-system",
ResourceRequest: true,
ResourceScope: requestctx.NamespaceScope,
ResourceScope: requestctx.ClusterScope,
}
decision, reason, err := t.authorizer.Authorize(createPodsExec)