@Override
    public Node<TroubleshootingContext> next(TroubleshootingContext context) throws HyscaleException {
        if (context.getResourceInfos() == null) {
            return serviceNotDeployedAction;
        }

        List<TroubleshootingContext.ResourceInfo> resourceInfos = context.getResourceInfos().getOrDefault(ResourceKind.POD.getKind(), null);
        if (resourceInfos == null || resourceInfos.isEmpty()) {
            if (context.isTrace()) {
                logger.debug("Cannot find any pods for the service {}", context.getServiceMetadata().getServiceName());
            }
            return parentStatusCondition;
        }
        PodStatus effectivePodStatus = PodStatus.DEFAULT;
        
        for (TroubleshootingContext.ResourceInfo each : resourceInfos) {
            if (each == null || each.getResource() == null) {
                continue;
            }
            if (each.getResource() instanceof V1Pod) {
                V1Pod v1Pod = (V1Pod) each.getResource();
                String aggregatedStatus = PodStatusUtil.currentStatusOf(v1Pod);
                if (context.isTrace()) {
                    logger.debug("Aggregated status of pod {} of service {}", v1Pod.getMetadata().getName(),
                            context.getServiceMetadata().getServiceName());
                }
                if (StringUtils.isEmpty(aggregatedStatus)) {
                    continue;
                }
                effectivePodStatus = PodStatus.get(aggregatedStatus);
                /*
                   First encountered  Pod that is failed
                 */
                if (effectivePodStatus.isFailed()) {
                    context.addAttribute(FailedResourceKey.OBSERVED_POD_STATUS, aggregatedStatus);
                    if (context.isTrace()) {
                        logger.debug("Observed failed pod {} and status {}", v1Pod.getMetadata().getName(), effectivePodStatus.getStatus());
                    }
                    context.addAttribute(FailedResourceKey.FAILED_POD, v1Pod);
                    context.addAttribute(FailedResourceKey.FAILED_POD_EVENTS, each.getEvents());
                    break;
                }
            }
        }
        return HyscaleContextUtil.getSpringBean(getNextNode(effectivePodStatus));
    }
{@link PodStatusCondition}  checks whether a kubernetes pod
has a status in @{@link PodStatus} . The condition is
checked based on the pod status from the {@link TroubleshootingContext}.
The status of all replicas is determined and aggregated when the first
failed state of any replica is encountered. Troubleshooting is
performed on this podstatus that is derived.
deployer/troubleshooting-integration/src/main/java/io/hyscale/troubleshooting/integration/conditions/PodStatusCondition.java