@Override
    public DeploymentStatus buildStatus(V1Deployment deployment) {
        if (deployment == null) {
            return null;
        }
        ResourceStatus resourceStatus = status(deployment);
        DeploymentStatus.ServiceStatus serviceStatus = ResourceStatus.getServiceStatus(resourceStatus);
        if (resourceStatus.equals(ResourceStatus.PENDING) && deployment.getStatus().getReadyReplicas() != null && deployment.getSpec().getReplicas() <= deployment.getStatus().getReadyReplicas()) {
            serviceStatus = DeploymentStatus.ServiceStatus.SCALING_DOWN;
        }
        if (deployment.getSpec().getReplicas() == 0 && resourceStatus.equals(ResourceStatus.STABLE)){
            serviceStatus = DeploymentStatus.ServiceStatus.NOT_RUNNING;
        }
        return buildStatusFromMetadata(deployment.getMetadata(), serviceStatus);
    }
@param deploymentList
@return list of service names from label of deployment
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1DeploymentHandler.java