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

     1  apiVersion: kuttl.dev/v1beta1
     2  kind: TestAssert
     3  timeout: 120
     4  ---
     5  apiVersion: argoproj.io/v1alpha1
     6  kind: ArgoCD
     7  metadata:
     8    name: example-argocd
     9  status:
    10    phase: Available
    11  ---
    12  apiVersion: v1
    13  kind: ConfigMap
    14  metadata:
    15    name: argocd-cm
    16  data:
    17    resource.customizations.health.certmanager.k8s.io_Certificate: |
    18      hs = {}
    19      if obj.status ~= nil then
    20        if obj.status.conditions ~= nil then
    21          for i, condition in ipairs(obj.status.conditions) do
    22            if condition.type == "Ready" and condition.status == "False" then
    23              hs.status = "Degraded"
    24              hs.message = condition.message
    25              return hs
    26            end
    27            if condition.type == "Ready" and condition.status == "True" then
    28              hs.status = "Healthy"
    29              hs.message = condition.message
    30              return hs
    31            end
    32          end
    33        end
    34      end
    35      hs.status = "Progressing"
    36      hs.message = "Waiting for certificate"
    37      return hs