Update am.go

This commit is contained in:
zryfish
2019-07-06 23:04:30 +08:00
parent d2452c97e8
commit 4c4af06cba

View File

@@ -628,13 +628,14 @@ func CreateClusterRoleBinding(username string, clusterRoleName string) error {
return err return err
} }
// create kubectl pod if cluster role is cluster-admin
if clusterRoleName == constants.ClusterAdmin { if clusterRoleName == constants.ClusterAdmin {
// create kubectl pod if cluster role is cluster-admin
if err := kubectl.CreateKubectlDeploy(username); err != nil { if err := kubectl.CreateKubectlDeploy(username); err != nil {
glog.Error("create user terminal pod failed", username, err) glog.Error("create user terminal pod failed", username, err)
} }
} else {
// delete kubectl pod if cluster role is not cluster-admin, whether it exists or not // delete kubectl pod if cluster role is not cluster-admin, whether it exists or not
} else {
if err := kubectl.DelKubectlDeploy(username); err != nil { if err := kubectl.DelKubectlDeploy(username); err != nil {
glog.Error("delete user terminal pod failed", username, err) glog.Error("delete user terminal pod failed", username, err)
} }