-
Notifications
You must be signed in to change notification settings - Fork 1k
Added command check when namespace-scoped Argo CD instance in testing #1958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThis PR fixes a comment typo and replaces placeholder/no-op assertions with real test checks that verify the notifications controller deployment command does not include the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
controllers/argocd/notifications.go(1 hunks)tests/ginkgo/parallel/1-055_validate_notification_controller_test.go(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build
- GitHub Check: build-operator
- GitHub Check: Run end-to-end tests (v1.27.1)
- GitHub Check: Run golangci-lint and gosec
🔇 Additional comments (2)
tests/ginkgo/parallel/1-055_validate_notification_controller_test.go (2)
21-21: LGTM!The
stringsimport is correctly added to support the command verification logic below.
213-224: LGTM! Test correctly validates namespace-scoped behavior.The test appropriately verifies that the
--application-namespacesflag is absent from the notifications controller deployment command for namespace-scoped Argo CD instances. The implementation:
- Properly handles errors and container existence checks
- Correctly constructs the command string for verification
- Uses appropriate timeout and polling intervals
This aligns with the controller logic in
getNotificationsCommandwhich only adds the flag whenIsNamespaceClusterConfigNamespacereturns true.
| } | ||
|
|
||
| // removeUnmanagedNotificationsSourceNamespaceResources cleansup resources from NotificationsSourceNamespaces if namespace is not managed by argocd instance. | ||
| // removeUnmanagedNotificationsSourceNamespaceResources cleanup resources from NotificationsSourceNamespaces if namespace is not managed by argocd instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incomplete grammar in the comment.
The comment uses "cleanup resources" which is grammatically incorrect. It should be "cleans up resources" to match standard Go documentation style where the comment completes the sentence starting with the function name.
Apply this diff:
-// removeUnmanagedNotificationsSourceNamespaceResources cleanup resources from NotificationsSourceNamespaces if namespace is not managed by argocd instance.
+// removeUnmanagedNotificationsSourceNamespaceResources cleans up resources from NotificationsSourceNamespaces if namespace is not managed by argocd instance.Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In controllers/argocd/notifications.go around line 917, update the function
comment that currently reads
"removeUnmanagedNotificationsSourceNamespaceResources cleanup resources from
NotificationsSourceNamespaces if namespace is not managed by argocd instance."
to correct grammar and follow Go doc style by changing it to
"removeUnmanagedNotificationsSourceNamespaceResources cleans up resources from
NotificationsSourceNamespaces if the namespace is not managed by the Argo CD
instance."
Signed-off-by: nmirasch <neus.miras@gmail.com>
5a8e196 to
60cc91e
Compare
|
|
||
| By("verifying Argo CD and notification controller start as expected") | ||
| Eventually(argocd, "4m", "5s").Should(argocdFixture.HaveNotificationControllerStatus("Running")) | ||
| Eventually(argocd, "5m", "5s").Should(argocdFixture.BeAvailable()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to skip this check. The application controller doesn't come up due to rbac issues when sourceNamespaces is set for namespaced scope instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after the fix for the namespaces validation it works as expected and comes up, that's the reason why I restored this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh okay. Good to know.
What type of PR is this?
/kind enhancement
What does this PR do / why we need it:
Added Controller command check at ginkgo testing of notifications in any namespace
Summary by CodeRabbit
Tests
Style
✏️ Tip: You can customize this high-level summary in your review settings.