Fix user status change after update

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2021-04-16 11:22:00 +08:00
parent 565a97fb6d
commit 744f88ea19

View File

@@ -66,8 +66,9 @@ func (im *imOperator) UpdateUser(new *iamv1alpha2.User) (*iamv1alpha2.User, erro
klog.Error(err)
return nil, err
}
// keep encrypted password
// keep encrypted password and user status
new.Spec.EncryptedPassword = old.Spec.EncryptedPassword
new.Status = old.Status
updated, err := im.ksClient.IamV1alpha2().Users().Update(context.Background(), new, metav1.UpdateOptions{})
if err != nil {
klog.Error(err)