Skip to content

Commit 080a5ae

Browse files
committed
Merge remote-tracking branch 'apache/4.18'
2 parents 05b0a8a + 3ce7c39 commit 080a5ae

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,12 +767,12 @@ protected String getKubernetesClusterNodeNamePrefix() {
767767
return prefix;
768768
}
769769

770-
protected KubernetesClusterVO updateKubernetesClusterEntry(final Long cores, final Long memory,
771-
final Long size, final Long serviceOfferingId, final Boolean autoscaleEnabled, final Long minSize, final Long maxSize) {
770+
protected KubernetesClusterVO updateKubernetesClusterEntry(final Long cores, final Long memory, final Long size,
771+
final Long serviceOfferingId, final Boolean autoscaleEnabled, final Long minSize, final Long maxSize) {
772772
return Transaction.execute(new TransactionCallback<KubernetesClusterVO>() {
773773
@Override
774774
public KubernetesClusterVO doInTransaction(TransactionStatus status) {
775-
KubernetesClusterVO updatedCluster = kubernetesClusterDao.createForUpdate(kubernetesCluster.getId());
775+
KubernetesClusterVO updatedCluster = kubernetesClusterDao.findById(kubernetesCluster.getId());
776776
if (cores != null) {
777777
updatedCluster.setCores(cores);
778778
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.apache.log4j.Level;
3333

3434
import com.cloud.dc.DataCenter;
35-
import com.cloud.exception.ConcurrentOperationException;
3635
import com.cloud.exception.InsufficientCapacityException;
3736
import com.cloud.exception.ManagementServerException;
3837
import com.cloud.exception.NetworkRuleConflictException;
@@ -299,8 +298,8 @@ private void scaleKubernetesClusterOffering() throws CloudRuntimeException {
299298
boolean result = false;
300299
try {
301300
result = userVmManager.upgradeVirtualMachine(userVM.getId(), serviceOffering.getId(), new HashMap<String, String>());
302-
} catch (ResourceUnavailableException | ManagementServerException | ConcurrentOperationException | VirtualMachineMigrationException e) {
303-
logTransitStateAndThrow(Level.ERROR, String.format("Scaling Kubernetes cluster : %s failed, unable to scale cluster VM : %s", kubernetesCluster.getName(), userVM.getDisplayName()), kubernetesCluster.getId(), KubernetesCluster.Event.OperationFailed, e);
301+
} catch (RuntimeException | ResourceUnavailableException | ManagementServerException | VirtualMachineMigrationException e) {
302+
logTransitStateAndThrow(Level.ERROR, String.format("Scaling Kubernetes cluster : %s failed, unable to scale cluster VM : %s due to %s", kubernetesCluster.getName(), userVM.getDisplayName(), e.getMessage()), kubernetesCluster.getId(), KubernetesCluster.Event.OperationFailed, e);
304303
}
305304
if (!result) {
306305
logTransitStateAndThrow(Level.WARN, String.format("Scaling Kubernetes cluster : %s failed, unable to scale cluster VM : %s", kubernetesCluster.getName(), userVM.getDisplayName()),kubernetesCluster.getId(), KubernetesCluster.Event.OperationFailed);

0 commit comments

Comments
 (0)