ArgoCD does not ignore helm.sh/hook when argocd.argoproj.io/hook is present'
Describe the bug
When a Kubernetes resource has both helm.sh/hook and argocd.argoproj.io/hook annotations, ArgoCD still treats it as a Helm hook and excludes it from the diff/sync process. According to the official documentation, defining any ArgoCD hooks should cause all Helm hooks to be ignored. This behavior is not observed in recent versions.
To Reproduce
- Create a Helm chart with a ConfigMap template containing:
apiVersion: v1 kind: ConfigMap metadata: name: example-configmap annotations: "helm.sh/hook": pre-install,pre-upgrade "helm.sh/hook-weight": "-20" "helm.sh/hook-delete-policy": before-hook-creation "argocd.argoproj.io/hook": Sync data: key: value - Deploy the chart via ArgoCD.
- Modify the data section in the Helm values or template.
- Run argocd app diff .
Expected behavior
ArgoCD should ignore helm.sh/hook annotations and treat the resource as a normal managed resource. The diff should show changes in the data section, and the resource should be included in sync operations. Reference: ArgoCD Helm Hooks Documentation (https://argo-cd.readthedocs.io/en/stable/user-guide/helm/) Helm hooks + ArgoCD hooks If you define any Argo CD hooks, all Helm hooks will be ignored.
Version v3.5.3
Logs
kubectl get app my-app -n argocd -o jsonpath='{.status.resources}' | python3 -m json.tool | grep -B 5 -A 10 'example-configmap' { "hook": true, "kind": "ConfigMap", "name": "example-configmap", "namespace": "default", "requiresPruning": true, "syncWave": -20, "version": "v1" }
Source: argoproj/argo-cd