Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4904 +/- ##
=======================================
Coverage 85.83% 85.83%
=======================================
Files 143 143
Lines 16719 16719
Branches 35 35
=======================================
+ Hits 14350 14351 +1
+ Misses 2118 2117 -1
Partials 251 251 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sjberman
reviewed
Mar 10, 2026
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| "helm.sh/hook": pre-install, pre-upgrade | ||
| "helm.sh/hook-delete-policy": before-hook-creation |
Collaborator
There was a problem hiding this comment.
Based on the helm docs, this is supposed to be the default behavior
Contributor
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Problem:
When deploying nginx-gateway-fabric helm chart (v2.4.2, for example), everything is deployed successfully initially (cert generator job enabled, by default).
Then, if something is changed in helm values or argocd application and argo detects it, it shows that argo wants to delete cert-generator ServiceAccount, Role & RoleBinding.
Bug 1: certGenerator.annotations not applied to ServiceAccount/Role/RoleBinding. In certs-job.yaml, the ServiceAccount, Role, and RoleBinding have hardcoded annotations with only "helm.sh/hook": pre-install. The certGenerator.annotations value is only used on the Job and pod template, but not on the ServiceAccount, Role, and RoleBinding.
This prevents users from adding ArgoCD-specific annotations (like argocd.argoproj.io/hook: PreSync) as a workaround.
Bug 2: Hook resources without pre-upgrade
The ServiceAccount, Role, and RoleBinding only have
"helm.sh/hook": pre-install, while the Job itself has"helm.sh/hook": pre-install, pre-upgrade. This causes the ArgoCD sync loop:Solution: The RBAC resources (ServiceAccount, Role, RoleBinding) should match the Job's hook annotation - pre-install, pre-upgrade - and all hook resources should have a
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeededannotation. This is the standard pattern for Helm hooks used with ArgoCD.Also, certGenerator.annotations needs to be wired into the metadata annotations of the ServiceAccount, Role, and RoleBinding, not just the Job.
Testing: Describe any testing that you did.
Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.
Closes #4896
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.