parkinr commented on code in PR #10362:
URL: https://github.com/apache/cloudstack/pull/10362#discussion_r1951184380
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -1384,7 +1384,15 @@ private String[] getServiceUserKeys(KubernetesClusterVO
kubernetesCluster) {
if (owner == null || owner.getType() == Account.Type.PROJECT) {
owner = CallContext.current().getCallingAccount();
}
- String username = owner.getAccountName() + "-" +
KUBEADMIN_ACCOUNT_NAME;
+
+ String projectId = "default";
+ Account account =
ApiDBUtils.findAccountById(kubernetesCluster.getAccountId());
+ Project project =
ApiDBUtils.findProjectByProjectAccountId(account.getId());
+ if ( project != null ) {
+ projectId = project.getUuid();
+ }
+
+ String username = owner.getAccountName() + "-" + projectId + "-" +
KUBEADMIN_ACCOUNT_NAME;
Review Comment:
That's a good idea. Will update the code as such. In our case, we always
have projectId.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]