Skip to content

Commit c822028

Browse files
weizhouapacheLocharla, Sandeep
authored andcommitted
CKS: generate a random UUID as password of CKS user in project (apache#11639)
1 parent c7b0005 commit c822028

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
@@ -1870,7 +1870,7 @@ protected Account createProjectKubernetesAccount(final Project project, final St
18701870
try {
18711871
Role role = getProjectKubernetesAccountRole();
18721872
UserAccount userAccount = accountService.createUserAccount(accountName,
1873-
UuidUtils.first(UUID.randomUUID().toString()), PROJECT_KUBERNETES_ACCOUNT_FIRST_NAME,
1873+
UUID.randomUUID().toString(), PROJECT_KUBERNETES_ACCOUNT_FIRST_NAME,
18741874
PROJECT_KUBERNETES_ACCOUNT_LAST_NAME, null, null, accountName, Account.Type.NORMAL, role.getId(),
18751875
project.getDomainId(), null, null, null, null, User.Source.NATIVE);
18761876
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
@@ -2754,7 +2754,10 @@ protected UserVO createUser(long accountId, String userName, String password, St
27542754
logger.debug("Creating user: " + userName + ", accountId: " + accountId + " timezone:" + timezone);
27552755
}
27562756

2757-
passwordPolicy.verifyIfPasswordCompliesWithPasswordPolicies(password, userName, getAccount(accountId).getDomainId());
2757+
Account callingAccount = getCurrentCallingAccount();
2758+
if (callingAccount.getId() != Account.ACCOUNT_ID_SYSTEM) {
2759+
passwordPolicy.verifyIfPasswordCompliesWithPasswordPolicies(password, userName, getAccount(accountId).getDomainId());
2760+
}
27582761

27592762
String encodedPassword = null;
27602763
for (UserAuthenticator authenticator : _userPasswordEncoders) {

0 commit comments

Comments
 (0)