When using spec.notifications.sourceNamespaces in a namespace-scoped ArgoCD instance, the notification logic did not properly verify that the ArgoCD CR matched the managed namespaces.
As a result, notification-related resources were created or left behind in namespaces that were not managed by the ArgoCD instance.
Additional Info
Issue affected notification logic during namespace source cleanup.
Notification deployment was not properly validating the --application-namespaces argument.
No specific logs required; issue identified by code review and testing
Problem Reproduction
Configure spec.notifications.sourceNamespaces to include namespaces not managed by the ArgoCD CR.
Reproducibility
Always
Prerequisites/Environment
OpenShift cluster
Namespace-scoped ArgoCD instance
ArgoCD Operator with Notifications enabled
User with namespace admin permissions
spec.notifications.sourceNamespaces configured
Steps to Reproduce
Create a namespace-scoped ArgoCD instance.
Configure spec.notifications.sourceNamespaces with additional namespaces.
Enable notifications.
Delete or update the ArgoCD instance.
Observe notification-related resources in non-managed namespaces
Expected Results
Notification resources should only be created in namespaces managed by the ArgoCD CR.
Cleanup should remove all notification resources correctly.
Notification deployment should validate application namespaces.
Actual Results
Notification resources were created or left behind in non-managed namespaces.
Cleanup did not fully remove notification-related resources.
Namespace validation was missing for notification logic.
Problem Analysis
The notification namespace cleanup logic did not verify that spec.notifications.sourceNamespaces matched the namespaces managed by the ArgoCD CR.
Additionally, notification testing did not validate the presence of the --application-namespaces argument.
Root Cause
<What is the root cause of the problem? Or, why is it not a bug?>
Workaround (If Possible)
<Are there any workarounds we can provide to the customers?>
Fix Approaches
<If we decide to fix this bug, how will we do it?>
Acceptance Criteria
...
Definition of Done
Code Complete:
All code has been written, reviewed, and approved.
Tested:
Unit tests have been written and passed.
Ensure code coverage is not reduced with the changes.
Integration tests have been automated.
System tests have been conducted, and all critical bugs have been fixed.
Tested and merged on OpenShift either upstream or downstream on a local build.
Documentation:
User documentation or release notes have been written (if applicable).
Build:
Code has been successfully built and integrated into the main repository / project.
Midstream changes (if applicable) are done, reviewed, approved and merged.
Review:
Code has been peer-reviewed and meets coding standards.
All acceptance criteria defined in the user story have been met.
Tested by reviewer on OpenShift.
Deployment:
The feature has been deployed on OpenShift cluster for testing.