in spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/PodUtils.java [62:81]
public static boolean isDriverPodStarted(final Pod driver, final ApplicationSpec spec) {
// Consider pod as 'started' if any of Spark container is started and ready
if (driver == null
|| driver.getStatus() == null
|| driver.getStatus().getContainerStatuses() == null
|| driver.getStatus().getContainerStatuses().isEmpty()) {
return false;
}
List<ContainerStatus> containerStatusList = driver.getStatus().getContainerStatuses();
// If there's only one container in given pod, evaluate it
// Otherwise, use the provided name as filter.
if (containerStatusList.size() == 1) {
return containerStatusList.get(0).getReady();
}
return findDriverMainContainerStatus(spec, containerStatusList).stream()
.anyMatch(ContainerStatus::getReady);
}