Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for using wildcard chars in sourceNamespaces for ArgoCD O…
…perator (#1218) * adding a new variable in ReconcileArgoCD struct call SourceNamespaces which store all the SourceNamespaces defined in Argocd Spec. sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func containsWildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func setManagedNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func setSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func sourceNamespacemapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update unit test for func reconcileRoleForApplicationSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update func SetupWithManager to watch newly created ns Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func sourceNamespacemapper which filter newly created ns Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update func setResourceWatches to watch newly created ns. added func sourceNamespaceFilterPredicate Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * go.mod/go.sum Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * unit tests func update Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func getSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func getSourceNamespaces. TestGetSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove SourceNamespaces from ReconcileArgoCD struct and use func getSourceNamespaces to get SourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * add to reviewers (#1196) Signed-off-by: saumeya <saumeyakatyal@gmail.com> Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * fix: Operator doesn't reflect deletion of SA from repo setting (#1169) Signed-off-by: Jayendra Parsai <jparsai@jparsai-thinkpadp1gen4i.remote.csb> Co-authored-by: Jayendra Parsai <jparsai@jparsai-thinkpadp1gen4i.remote.csb> Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * feat: Notification service monitor (#1187) * feat: Expose notifications controller metrics to prometheus monitoring --------- Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com> Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Fix status operation value to allow less than 10 (#1198) * fix logic to allow processor operation to be less than default --------- Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * comment remove Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * fix goimports Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * undo changes in generated codes Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Revert "comment remove" This reverts commit c5d2f57. Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove comments and rename sourceNamespacemapper function to sourceNamespaceMapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace without wildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace with wildcard pattern Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace with wildcard '*' Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update with master branch and remove verbs from role in e2e test assert and errors Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * comment for sourceNamespaceMapper function Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Change the variable name sourceNamespacemapper to sourceNamespaceMapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Removed unwanted blank lines in this function. Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adeed comment for sourceNamespaceFilterPredicate and getSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding a new variable in ReconcileArgoCD struct call SourceNamespaces which store all the SourceNamespaces defined in Argocd Spec. sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func containsWildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func setManagedNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * range r.SourceNamespaces instead of cr.Spec.SourceNamespaces, cr.Spec.SourceNamespaces might contain wildcard which will lead to error i.e. Namespace * not found Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func setSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func sourceNamespacemapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update unit test for func reconcileRoleForApplicationSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update func SetupWithManager to watch newly created ns Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func sourceNamespacemapper which filter newly created ns Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update func setResourceWatches to watch newly created ns. added func sourceNamespaceFilterPredicate Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * go.mod/go.sum Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * unit tests func update Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding func getSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adding unit test for func getSourceNamespaces. TestGetSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove SourceNamespaces from ReconcileArgoCD struct and use func getSourceNamespaces to get SourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Fix status operation value to allow less than 10 (#1198) * fix logic to allow processor operation to be less than default --------- Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * comment remove Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * fix goimports Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * undo changes in generated codes Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Revert "comment remove" This reverts commit c5d2f57. Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove comments and rename sourceNamespacemapper function to sourceNamespaceMapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace without wildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace with wildcard pattern Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for source namespace with wildcard '*' Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * e2e test to valitade role and rolebinding for sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update with master branch and remove verbs from role in e2e test assert and errors Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * comment for sourceNamespaceMapper function Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Change the variable name sourceNamespacemapper to sourceNamespaceMapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * Removed unwanted blank lines in this function. Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * adeed comment for sourceNamespaceFilterPredicate and getSourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * resolve merge conficts Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * resolve merge conficts Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * removed unwanted blank lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * removed unwanted blank lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * added unit test cases for getSourceNamespaces and sourceNamespaceMapper func Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * added unit test for multiple sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * added e2e test for multiple sourceNamespaces Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * eremoved extra lines from sourceNamespaceMapper Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * documentation for supporting wildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * documentation for supporting wildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * documentation for supporting wildcard Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * documentation for supporting wildcard and Link for Allowing additional namespaces in an AppProject Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove placeholder code Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * removed additional lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remote extra watch on namespace resource Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remote sourceNamespaceFilterPredicate func Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update TestReconcileApplicationSet_Deployments_Command func. getSourceNamespaces expect ns must exist Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove extra lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * small update on documentation Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove extra lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * remove extra lines Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * add e2e test to validate labels,role and rolebinding,after removing namespace from sourcenamespace Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> * update e2e test to check for labels in ns which is in sourceNamespace Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> --------- Signed-off-by: Mangaal <angommeeteimangaal@gmail.com> Signed-off-by: saumeya <saumeyakatyal@gmail.com> Signed-off-by: Jayendra Parsai <jparsai@jparsai-thinkpadp1gen4i.remote.csb> Signed-off-by: iam-veeramalla <abhishek.veeramalla@gmail.com> Signed-off-by: Anand Kumar Singh <anandrkskd@gmail.com> Co-authored-by: Saumeya Katyal <saumeyakatyal@gmail.com> Co-authored-by: Jayendra Parsai <jparsai@redhat.com> Co-authored-by: Jayendra Parsai <jparsai@jparsai-thinkpadp1gen4i.remote.csb> Co-authored-by: Abhishek Veeramalla <abhishek.veeramalla@gmail.com> Co-authored-by: Anand Kumar Singh <anandrkskd@gmail.com>
- Loading branch information