github.com/argoproj-labs/argocd-operator@v0.10.0/tests/k8s/1-024_validate_resource_health_checks/01-argocd-with-resource-health-check.yaml (about)

     1  apiVersion: argoproj.io/v1alpha1
     2  kind: ArgoCD
     3  metadata:
     4    name: example-argocd
     5  spec:
     6    resourceHealthChecks:
     7    - group: certmanager.k8s.io
     8      kind: Certificate
     9      check: |
    10        hs = {}
    11        if obj.status ~= nil then
    12          if obj.status.conditions ~= nil then
    13            for i, condition in ipairs(obj.status.conditions) do
    14              if condition.type == "Ready" and condition.status == "False" then
    15                hs.status = "Degraded"
    16                hs.message = condition.message
    17                return hs
    18              end
    19              if condition.type == "Ready" and condition.status == "True" then
    20                hs.status = "Healthy"
    21                hs.message = condition.message
    22                return hs
    23              end
    24            end
    25          end
    26        end
    27        hs.status = "Progressing"
    28        hs.message = "Waiting for certificate"
    29        return hs