mirror of
https://github.com/1Panel-dev/KubePi.git
synced 2025-11-03 03:03:27 +08:00
fix(cluster-role): 放行admin 端口
This commit is contained in:
@@ -128,11 +128,13 @@ func (h *Handler) CreateCluster() iris.Handler {
|
||||
ctx.Values().Set("message", []string{"permission %s required", notAllowed})
|
||||
return
|
||||
}
|
||||
if err := client.CreateOrUpdateClusterRoleBinding("cluster-owner", profile.Name, true); err != nil {
|
||||
_ = tx.Rollback()
|
||||
ctx.StatusCode(iris.StatusInternalServerError)
|
||||
ctx.Values().Set("message", err.Error())
|
||||
return
|
||||
if !profile.IsAdministrator {
|
||||
if err := client.CreateOrUpdateClusterRoleBinding("cluster-owner", profile.Name, true); err != nil {
|
||||
_ = tx.Rollback()
|
||||
ctx.StatusCode(iris.StatusInternalServerError)
|
||||
ctx.Values().Set("message", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
_ = tx.Commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user