chore: Simplify reconcile change detection#2078
chore: Simplify reconcile change detection#2078olivergondza wants to merge 1 commit intoargoproj-labs:masterfrom
Conversation
Signed-off-by: Oliver Gondža <ogondza@gmail.com>
📝 WalkthroughWalkthroughThis is a systematic refactoring across multiple Argo CD controller files that standardizes change tracking and logging. The changes replace boolean flags and concatenated explanation strings with slices of descriptive strings, which are then logged as comma-separated lists when updates occur. This affects how updates are reported without changing the functional behavior of the reconciliation logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@controllers/argocd/statefulset.go`:
- Around line 454-456: The code updates the wrong container index when syncing
image pull policy: when comparing
existing.Spec.Template.Spec.Containers[i].ImagePullPolicy to
ss.Spec.Template.Spec.Containers[i].ImagePullPolicy it mistakenly assigns to
existing.Spec.Template.Spec.Containers[0].ImagePullPolicy; change the assignment
to use index i (existing.Spec.Template.Spec.Containers[i].ImagePullPolicy =
ss.Spec.Template.Spec.Containers[i].ImagePullPolicy) so the specific mismatched
container is corrected and keep the existing changes append("image pull policy")
logic as-is.
What type of PR is this?
/kind chore
For manifest change detection, this replaces boolean and string reason accumulation with a slice of causes. The change is then detected by existence or 1+ causes.
What does this PR do / why we need it:
Have you updated the necessary documentation?
Which issue(s) this PR fixes:
Fixes #?
How to test changes / Special notes to the reviewer:
Tests are passing
Summary by CodeRabbit
Refactor
Tests