Support skip information reconfirm when using external IDP

Signed-off-by: hongming <hongming@kubesphere.io>
This commit is contained in:
hongming
2021-09-15 11:20:05 +08:00
parent 7f2397678d
commit cb947ce505
4 changed files with 55 additions and 8 deletions

View File

@@ -58,6 +58,10 @@ func (a *EmailValidator) Handle(ctx context.Context, req admission.Request) admi
}
func emailAlreadyExist(users v1alpha2.UserList, user *v1alpha2.User) bool {
// empty email is allowed
if user.Spec.Email == "" {
return false
}
for _, exist := range users.Items {
if exist.Spec.Email == user.Spec.Email && exist.Name != user.Name {
return true