github.com/argoproj/argo-cd/v2@v2.10.9/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua (about)

     1  local health_check = {}
     2  if obj.status ~= nil then
     3    if obj.status.conditions ~= nil and obj.status.replicas ~= nil then
     4      local numTrue = 0
     5      for i, condition in pairs(obj.status.conditions) do
     6        if (condition.type == "Available" or (condition.type == "Progressing" and condition.reason == "NewReplicationControllerAvailable")) and condition.status == "True" then
     7          numTrue = numTrue + 1
     8        end
     9      end
    10      if numTrue == 2 or obj.status.replicas == 0 then
    11        health_check.status = "Healthy"
    12        health_check.message = "replication controller successfully rolled out"
    13        return health_check
    14      elseif numTrue == 1 then
    15        health_check.status = "Progressing"
    16        health_check.message = "replication controller is waiting for pods to run"
    17        return health_check
    18      else
    19        health_check.status = "Degraded"
    20        health_check.message = "Deployment config is degraded"
    21        return health_check
    22      end
    23    end
    24  end
    25  health_check.status = "Progressing"
    26  health_check.message = "replication controller is waiting for pods to run"
    27  return health_check