Skip to content

Commit be1f403

Browse files
committed
Kubernetes: fix logging exception
1 parent 6a14ffb commit be1f403

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ private DeployDestination plan(final long nodesCount, final DataCenter zone, fin
537537
}
538538
if (capacityManager.checkIfHostHasCapacity(h.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) {
539539
if (LOGGER.isDebugEnabled()) {
540-
LOGGER.debug(String.format("Found host ID: %s for with enough capacity, CPU=%d RAM=%d", h.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)));
540+
LOGGER.debug(String.format("Found host ID: %s for with enough capacity, CPU=%d RAM=%s", h.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)));
541541
}
542542
hostEntry.setValue(new Pair<HostVO, Integer>(h, reserved));
543543
suitable_host_found = true;
@@ -558,7 +558,7 @@ private DeployDestination plan(final long nodesCount, final DataCenter zone, fin
558558
}
559559
return new DeployDestination(zone, null, planCluster, null);
560560
}
561-
String msg = String.format("Cannot find enough capacity for Kubernetes cluster(requested cpu=%d memory=%d) with offering ID: %s",
561+
String msg = String.format("Cannot find enough capacity for Kubernetes cluster(requested cpu=%d memory=%s) with offering ID: %s",
562562
cpu_requested * nodesCount, toHumanReadableSize(ram_requested * nodesCount), offering.getUuid());
563563
LOGGER.warn(msg);
564564
throw new InsufficientServerCapacityException(msg, DataCenter.class, zone.getId());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected DeployDestination plan(final long nodesCount, final DataCenter zone, f
231231
}
232232
if (capacityManager.checkIfHostHasCapacity(h.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) {
233233
if (LOGGER.isDebugEnabled()) {
234-
LOGGER.debug(String.format("Found host ID: %s for with enough capacity, CPU=%d RAM=%d", h.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)));
234+
LOGGER.debug(String.format("Found host ID: %s for with enough capacity, CPU=%d RAM=%s", h.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)));
235235
}
236236
hostEntry.setValue(new Pair<HostVO, Integer>(h, reserved));
237237
suitable_host_found = true;
@@ -251,7 +251,7 @@ protected DeployDestination plan(final long nodesCount, final DataCenter zone, f
251251
}
252252
return new DeployDestination(zone, null, null, null);
253253
}
254-
String msg = String.format("Cannot find enough capacity for Kubernetes cluster(requested cpu=%d memory=%d) with offering ID: %s and hypervisor: %s",
254+
String msg = String.format("Cannot find enough capacity for Kubernetes cluster(requested cpu=%d memory=%s) with offering ID: %s and hypervisor: %s",
255255
cpu_requested * nodesCount, toHumanReadableSize(ram_requested * nodesCount), offering.getUuid(), clusterTemplate.getHypervisorType().toString());
256256

257257
LOGGER.warn(msg);

0 commit comments

Comments
 (0)