bernardodemarco commented on code in PR #9102:
URL: https://github.com/apache/cloudstack/pull/9102#discussion_r1943484373


##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java:
##########
@@ -795,8 +782,27 @@ protected String getKubernetesClusterNodeNamePrefix() {
         return prefix;
     }
 
+    protected String getEtcdNodeNameForCluster() {
+        String prefix = kubernetesCluster.getName();
+        if (!NetUtils.verifyDomainNameLabel(prefix, true)) {
+            prefix = prefix.replaceAll("[^a-zA-Z0-9-]", "");
+            if (prefix.isEmpty()) {
+                prefix = kubernetesCluster.getUuid();
+            }
+        }
+        prefix = prefix + "-etcd" ;
+        if (prefix.length() > 40) {
+            prefix = prefix.substring(0, 40);
+        }
+        return prefix;
+    }
+
     protected KubernetesClusterVO updateKubernetesClusterEntry(final Long 
cores, final Long memory, final Long size,
-               final Long serviceOfferingId, final Boolean autoscaleEnabled, 
final Long minSize, final Long maxSize) {
+                                                               final Long 
serviceOfferingId, final Boolean autoscaleEnabled,
+                                                               final Long 
minSize, final Long maxSize,
+                                                               final 
KubernetesClusterNodeType nodeType,
+                                                               final boolean 
updateNodeOffering,
+                                                               final boolean 
updateClusterOffering) {
         return Transaction.execute((TransactionCallback<KubernetesClusterVO>) 
status -> {
             KubernetesClusterVO updatedCluster = 
kubernetesClusterDao.createForUpdate(kubernetesCluster.getId());

Review Comment:
   @nvazquez, here is how I locally fixed this issue:
   
   ```java
       protected KubernetesClusterVO updateKubernetesClusterEntry(...) {
           return 
Transaction.execute((TransactionCallback<KubernetesClusterVO>) status -> {
               KubernetesClusterVO updatedCluster = 
kubernetesClusterDao.createForUpdate(kubernetesCluster.getId());
   
   // (...)
              
               kubernetesClusterDao.persist(updatedCluster);
               return kubernetesClusterDao.findById(kubernetesCluster.getId());
           });
       }
   ```



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to