Skip to content
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

Add Application and Secret watches #18

Merged
merged 35 commits into from
Feb 23, 2021
Merged

Add Application and Secret watches #18

merged 35 commits into from
Feb 23, 2021

Conversation

maruina
Copy link
Contributor

@maruina maruina commented Feb 19, 2021

Fix #5

  • Add defer GinkgoRecover() when starting k8sManager so we can see the real issue. Instead of a Ginkgo panic, we can see the real issue. First screenshot is without the defer.

image

image

  • Add ArgoCD Application CRD to fix the issue above
  • Add scripts to import ArgoCD Application package
  • Use recommended Ginkgo CI settings
  • Restructure test to allow multiple Describe block
  • Randomize namespace creation for each Describe block
  • Add test for checking if a secret is an ArgoCD cluster
  • Add tests for watches
  • Build only when we merge into main
  • Add RBAC for watching secrets and applications
  • Added a predicate to the secret watch to get an event on labels update as per https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.2/pkg/predicate#LabelChangedPredicate
  • Create utils package for internal common utilities

Makefile Show resolved Hide resolved
api/v1alpha1/progressiverollout_types.go Outdated Show resolved Hide resolved
config/crd/bases/argoproj.io_application.yaml Outdated Show resolved Hide resolved
controllers/progressiverollout_controller.go Outdated Show resolved Hide resolved
controllers/progressiverollout_controller.go Outdated Show resolved Hide resolved
controllers/progressiverollout_controller.go Show resolved Hide resolved
controllers/progressiverollout_controller.go Outdated Show resolved Hide resolved
internal/utils.go Outdated Show resolved Hide resolved
.github/workflows/test-build.yaml Show resolved Hide resolved
api/v1alpha1/progressiverollout_types.go Outdated Show resolved Hide resolved
internal/utils.go Outdated Show resolved Hide resolved
controllers/progressiverollout_controller.go Show resolved Hide resolved
controllers/progressiverollout_controller.go Show resolved Hide resolved
controllers/progressiverollout_controller.go Show resolved Hide resolved
internal/utils.go Outdated Show resolved Hide resolved
Smirl
Smirl previously approved these changes Feb 22, 2021
@@ -73,7 +78,8 @@ func (r *ProgressiveRolloutReconciler) SetupWithManager(mgr ctrl.Manager) error
&source.Kind{Type: &argov1alpha1.Application{}},
handler.EnqueueRequestsFromMapFunc(r.requestsForApplicationChange)).
Watches(
&source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.requestsForSecretChange)).
&source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.requestsForSecretChange),
builder.WithPredicates(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{}))).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@sledigabel sledigabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maruina maruina merged commit a13aacf into main Feb 23, 2021
@maruina maruina deleted the watch branch February 23, 2021 09:16
maruina added a commit that referenced this pull request Feb 23, 2021
* main:
  Add Application and Secret watches (#18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Application and Secret watch
3 participants