rhtyd commented on a change in pull request #5254:
URL: https://github.com/apache/cloudstack/pull/5254#discussion_r681451461



##########
File path: 
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java
##########
@@ -1093,13 +1111,39 @@ public boolean startKubernetesCluster(long 
kubernetesClusterId, boolean onCreate
         startWorker = ComponentContext.inject(startWorker);
         if (onCreate) {
             // Start for Kubernetes cluster in 'Created' state
+            Account owner = 
accountService.getActiveAccountById(kubernetesCluster.getAccountId());
+            String[] keys = getServiceUserKeys(owner);
+            startWorker.setKeys(keys);
             return startWorker.startKubernetesClusterOnCreate();
         } else {
             // Start for Kubernetes cluster in 'Stopped' state. Resources are 
already provisioned, just need to be started
             return startWorker.startStoppedKubernetesCluster();
         }
     }
 
+    private String[] getServiceUserKeys(Account owner) {
+        if (owner == null) {
+            owner = CallContext.current().getCallingAccount();
+        }
+        String username = owner.getAccountName() + "-" + 
KUBEADMIN_ACCOUNT_NAME;

Review comment:
       Nevermind read the code, looks like we create if it doesn't exist.




-- 
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]


Reply via email to