Skip to content

Commit c631d6a

Browse files
CKS: generate a random UUID as password of CKS user in project (#11639)
1 parent 70af55e commit c631d6a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ protected Account createProjectKubernetesAccount(final Project project, final St
15511551
try {
15521552
Role role = getProjectKubernetesAccountRole();
15531553
UserAccount userAccount = accountService.createUserAccount(accountName,
1554-
UuidUtils.first(UUID.randomUUID().toString()), PROJECT_KUBERNETES_ACCOUNT_FIRST_NAME,
1554+
UUID.randomUUID().toString(), PROJECT_KUBERNETES_ACCOUNT_FIRST_NAME,
15551555
PROJECT_KUBERNETES_ACCOUNT_LAST_NAME, null, null, accountName, Account.Type.NORMAL, role.getId(),
15561556
project.getDomainId(), null, null, null, null, User.Source.NATIVE);
15571557
projectManager.assignAccountToProject(project, userAccount.getAccountId(), ProjectAccount.Role.Regular,

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,10 @@ protected UserVO createUser(long accountId, String userName, String password, St
27472747
logger.debug("Creating user: " + userName + ", accountId: " + accountId + " timezone:" + timezone);
27482748
}
27492749

2750-
passwordPolicy.verifyIfPasswordCompliesWithPasswordPolicies(password, userName, getAccount(accountId).getDomainId());
2750+
Account callingAccount = getCurrentCallingAccount();
2751+
if (callingAccount.getId() != Account.ACCOUNT_ID_SYSTEM) {
2752+
passwordPolicy.verifyIfPasswordCompliesWithPasswordPolicies(password, userName, getAccount(accountId).getDomainId());
2753+
}
27512754

27522755
String encodedPassword = null;
27532756
for (UserAuthenticator authenticator : _userPasswordEncoders) {

0 commit comments

Comments
 (0)