public Pair extractFailedContainer()

in src/main/java/com/epam/aidial/util/KubernetesUtils.java [100:112]


    public Pair<String, String> extractFailedContainer(V1PodList podList) {
        for (V1Pod pod : podList.getItems()) {
            if ("Failed".equals(pod.getStatus().getPhase())) {
                String podName = pod.getMetadata().getName();
                String containerName = findFailedContainerName(pod.getStatus())
                        .orElseThrow(() -> new IllegalStateException(
                                "Couldn't find a terminated container in pod %s".formatted(podName)));
                return Pair.of(podName, containerName);
            }
        }

        return null;
    }