argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.93k stars 5.46k forks source link

cert-manager.io/certificate health status always shows "Progressing" #18597

Open cyrus-mc opened 5 months ago

cyrus-mc commented 5 months ago

Checklist:

Describe the bug

https://github.com/argoproj/argo-cd/pull/16520

I believe this issue was introduced in the above change. The check has two separate loops. The first section checks all conditions for type = "Issuing" and status = "True" and if found, sets the health status to Progressing.

Code:

    -- Always Handle Issuing First to ensure consistent behaviour
    for i, condition in ipairs(obj.status.conditions) do
      if condition.type == "Issuing" and condition.status == "True" then
        hs.status = "Progressing"
        hs.message = condition.message
        return hs
      end

When presented with the following status conditions:

status:
  conditions:
  - lastTransitionTime: "2024-04-09T23:38:04Z"
    message: Certificate is up to date and has not expired
    observedGeneration: 1
    reason: Ready
    status: "True"
    type: Ready
  - lastTransitionTime: "2024-06-08T22:38:03Z"
    message: Renewing certificate as renewal was scheduled at 2024-06-08 22:38:03
      +0000 UTC
    observedGeneration: 1
    reason: Renewing
    status: "True"
    type: Issuing

The health check will always set to progressing, even though the renewal has been issued successfully.

To Reproduce

Generate a certificate, and wait for renewal. Once the renewal has been issued the health status will stay in Progressing in ArgoCD.

Expected behavior

After the renewal has been successfully issued the health status should show Ready.

Version

ArgoCD version 2.10.

I worked around this issue by creating a resource customization and setting the health check back to pre-2.10 (https://github.com/argoproj/argo-cd/blob/v2.9.17/resource_customizations/cert-manager.io/Certificate/health.lua).

andrii-korotkov-verkada commented 3 days ago

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and let us know if the issue is still present, please?