fix bug:db init failed,clusterrolebinding sync error

This commit is contained in:
hongming
2018-11-20 13:03:33 +08:00
parent 7f780bd3fb
commit 49d40f48f7
5 changed files with 60 additions and 29 deletions

View File

@@ -50,7 +50,7 @@ func (ctl *ClusterRoleBindingCtl) total() int {
}
func (ctl *ClusterRoleBindingCtl) handleWorkspaceRoleChange(clusterRole *rbac.ClusterRoleBinding) {
if groups := regexp.MustCompile("^system:(\\w+):(admin|operator|viewer)$").FindStringSubmatch(clusterRole.Name); len(groups) == 3 {
if groups := regexp.MustCompile(`^system:(\S+):(admin|operator|viewer)$`).FindStringSubmatch(clusterRole.Name); len(groups) == 3 {
workspace := groups[1]
go ctl.restNamespaceRoleBinding(workspace)
}