argoproj / argo-cd

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

Disabling of build-in tools not working #11426

Open adrianmoisey opened 2 years ago

adrianmoisey commented 2 years ago

Checklist:

Describe the bug

I am attempting to disable kustomize, as described here: https://argo-cd.readthedocs.io/en/stable/user-guide/tool_detection/#disable-built-in-tools Unfortunately kustomize still works

To Reproduce

  1. Deploy ArgoCD to a cluster
  2. Edit the ConfigMap named argocd-cm
  3. Add kustomize.enable: "false" to the ConfigMap under data
  4. Restart all ArgoCD components
  5. Login to the ArgoCD UI and add a project pointing at https://github.com/argoproj/argocd-example-apps/tree/master/kustomize-guestbook

Expected behavior

Syncing to fail and guestbook example not deployed

Screenshots

N/A

Version

$ kubectl exec -ti my-argo-cd-argocd-server-84fbbb7b77-jk4fr -- argocd version
argocd: v2.5.2+148d8da
  BuildDate: 2022-11-07T16:42:47Z
  GitCommit: 148d8da7a996f6c9f4d102fdd8e688c2ff3fd8c7
  GitTreeState: clean
  GoVersion: go1.18.8
  Compiler: gc
  Platform: linux/amd64
FATA[0000] Argo CD server address unspecified
command terminated with exit code 1

Logs

I can't find any relevant logs. I also tried to see if I can find useful logs, but could not.

adrianmoisey commented 2 years ago

The more I look into this, the more I wonder if it's something being cached

crenshaw-dev commented 2 years ago

Even if the response is cached, changing the allowed tool setting should probably bust the cache (or otherwise preclude returning manifests from a disallowed build tool).

adrianmoisey commented 2 years ago

Even if the response is cached, changing the allowed tool setting should probably bust the cache (or otherwise preclude returning manifests from a disallowed build tool).

Agreed!

Another method I've been using for testing:

  1. Deploy ArgoCD to a cluster (using the argo-cd helm chart)
  2. Restart all ArgoCD components
  3. Login to the ArgoCD UI and add a project pointing at https://github.com/argoproj/argocd-example-apps/tree/master/kustomize-guestbook
  4. Watch it deploy
  5. Delete the said app
  6. Edit the ConfigMap named argocd-cm
  7. Add kustomize.enable: "false" to the ConfigMap under data
  8. Restart all argocd components
  9. Re-add the kustomize-guestbook example

I expect it to fail, but it doesn't fail.

I've dug into the code a but, but I can't figure out how it works. I'm also not sure how argocd reads the argocd-cm ConfigMap