add job controller

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-04-26 17:21:43 +08:00
committed by zryfish
parent ece9049836
commit 9a530c2cec
5 changed files with 368 additions and 8 deletions

View File

@@ -671,16 +671,13 @@ func CreateClusterRoleBinding(username string, clusterRoleName string) error {
maxRetries := 3
for i := 0; i < maxRetries; i++ {
_, err = k8s.Client().RbacV1().ClusterRoleBindings().Create(clusterRoleBinding)
if apierrors.IsAlreadyExists(err) {
time.Sleep(300 * time.Millisecond)
continue
}
if err != nil {
glog.Errorln("create cluster role binding", err)
return err
if err == nil {
return nil
}
time.Sleep(300 * time.Millisecond)
}
return nil
glog.Errorln("create cluster role binding", err)
return err
}
if !k8sutil.ContainsUser(found.Subjects, username) {