private static String validateAndGetContainerStatuses(List<V1ContainerStatus> containerStatuses) {
        if (containerStatuses == null || containerStatuses.isEmpty()) {
            return null;
        }
        String aggregateStatus = null;
        for (V1ContainerStatus each : containerStatuses) {
            if (!each.getReady() && each.getLastState() != null) {
                if (each.getLastState().getTerminated() != null) {
                    aggregateStatus = each.getLastState().getTerminated().getReason();
                    break;
                } else if (each.getLastState().getWaiting() != null) {
                    aggregateStatus = each.getLastState().getWaiting().getReason();
                    break;
                }
            }
            if (each.getState().getRunning() == null) {
                if (each.getState().getTerminated() != null) {
                    aggregateStatus = each.getState().getTerminated().getReason();
                    break;
                } else if (each.getState().getWaiting() != null) {
                    aggregateStatus = each.getState().getWaiting().getReason();
                    break;
                }
            }
        }
        return aggregateStatus;
    }
@param containerStatuses
@return status of container not in running state
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/util/K8sPodUtil.java