Skip to content

Commit

Permalink
Fix spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt committed Sep 27, 2024
1 parent ec277c8 commit 2847851
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ private static List<HealthCheckResult> 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());
}
Expand All @@ -67,6 +69,8 @@ private static List<HealthCheckResult> 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());
}
Expand All @@ -80,6 +84,8 @@ private static List<HealthCheckResult> 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());
}
Expand Down

0 comments on commit 2847851

Please sign in to comment.