Skip to content

Commit

Permalink
Add debug log in K8sUtil.waitForPodStateRunning()
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnerbart committed Dec 4, 2024
1 parent ed51e6f commit 32281d3
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,17 @@ public static void waitForPodStateRunning(
.inNamespace(namespace)
.withLabels(labels)
.waitUntilCondition(pod -> pod != null &&
pod.getStatus()
.getContainerStatuses()
.stream()
.allMatch(containerStatus -> containerStatus.getReady() &&
containerStatus.getStarted()), 3, TimeUnit.MINUTES);
pod.getStatus().getContainerStatuses().stream().allMatch(containerStatus -> {
final var ready = containerStatus.getReady() && containerStatus.getStarted();
if (ready) {
LOG.info("Pod '{}' is ready", pod.getMetadata().getName());
} else {
LOG.debug("Waiting for Pod '{}' to be ready: {}",
pod.getMetadata().getName(),
containerStatus);
}
return ready;
}), 3, TimeUnit.MINUTES);
}

private static <T extends HasMetadata> @NotNull Resource<T> loadResource(
Expand Down

0 comments on commit 32281d3

Please sign in to comment.