From 2847851fc93383ffb4bdf703f7b98edfc45d0da6 Mon Sep 17 00:00:00 2001 From: Olivier Levitt Date: Fri, 27 Sep 2024 16:26:50 +0200 Subject: [PATCH] Fix spotless --- .../onyxia/api/services/impl/HelmReleaseHealthResolver.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onyxia-api/src/main/java/fr/insee/onyxia/api/services/impl/HelmReleaseHealthResolver.java b/onyxia-api/src/main/java/fr/insee/onyxia/api/services/impl/HelmReleaseHealthResolver.java index b1bf02cc..e34b58f2 100644 --- a/onyxia-api/src/main/java/fr/insee/onyxia/api/services/impl/HelmReleaseHealthResolver.java +++ b/onyxia-api/src/main/java/fr/insee/onyxia/api/services/impl/HelmReleaseHealthResolver.java @@ -54,6 +54,8 @@ private static List checkHealth( .withName(name) .get(); details.setDesired(deployment.getSpec().getReplicas()); + // If replicas is 0 then readyReplicas is not defined (and can't be + // different from 0 anyway) if (deployment.getStatus().getReplicas() > 0) { details.setReady(deployment.getStatus().getReadyReplicas()); } @@ -67,6 +69,8 @@ private static List checkHealth( .withName(name) .get(); details.setDesired(statefulset.getSpec().getReplicas()); + // If replicas is 0 then readyReplicas is not defined (and can't be + // different from 0 anyway) if (statefulset.getStatus().getReplicas() > 0) { details.setReady(statefulset.getStatus().getReadyReplicas()); } @@ -80,6 +84,8 @@ private static List checkHealth( .withName(name) .get(); details.setDesired(daemonSet.getStatus().getDesiredNumberScheduled()); + // If replicas is 0 then readyReplicas is not defined (and can't be + // different from 0 anyway) if (daemonSet.getStatus().getNumberAvailable() > 0) { details.setReady(daemonSet.getStatus().getNumberReady()); }