argoproj / argo-cd

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

argo blocks with "internal error occurred: error resolving resource" when a CRD is broken #18041

Open hsmade opened 2 weeks ago

hsmade commented 2 weeks ago

Checklist:

Describe the bug

I found an issue with another operator (capi), which has conversion tags in its CRDs pointing to a webhook service it runs. When this service is unavailable, the k8s API server will respond with internal error occurred: error resolving resource when a CR list is requested.

Now this is all understandable. It's annoying, but still, the API is right in a sense. The problem however, is that when Argo CD tries to refresh an Application, it will ask for all known resources (including those of this broken CRD), and stop because of this error. Even if the Application here doesn't use this CRD.

To Reproduce

Install CAPI operator without having cert-manager installed. Then add any Application to argo and let it refresh / sync.

Expected behavior

I would expect Argo CD to warn about this, but not break the Application refresh/sync. It should lead to Applications not finishing the sync, if the CRD in question is used, but otherwise, it should continue to work.

Screenshots

Version

{
    "Version": "v2.9.5+f943664",
    "BuildDate": "2024-01-19T17:57:57Z",
    "GitCommit": "f9436641a616d277ab1f98694e5ce4c986d4ea05",
    "GitTreeState": "clean",
    "GoVersion": "go1.21.3",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 2023-10-19T20:13:51Z",
    "HelmVersion": "v3.13.2+g2a2fb3b",
    "KubectlVersion": "v0.24.17",
    "JsonnetVersion": "v0.20.0"
}
Paste the output from `argocd version` here.

Logs

Paste any relevant application logs here.