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

WIP: Proposal for PR changes on ClusterCloudEventSource #5924

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wozniakjan
Copy link
Member

#5816 is in the process of introducing cluster scoped version of CloudEventSource. For simpler PR review, I would like to use this to communicate better some of my ideas for potential improvements

Checklist

  • this is not intended to merge

Fixes #

Relates to #5816

…entSource

Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
@SpiritZhou
Copy link
Contributor

SpiritZhou commented Jul 2, 2024

I agree with this improvement to reduce code redundancy. Triggerauthentication and clustertriggerauthentication are in the same situation and can be refactored using similar methods.

return ctrl.NewControllerManagedBy(mgr).
For(&eventingv1alpha1.ClusterCloudEventSource{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
Copy link
Contributor

Choose a reason for hiding this comment

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

Reconciliation cannot accept multiple objects. I think we should still set up multiple controllers and eliminate the duplicates through abstraction.

Copy link
Member Author

@wozniakjan wozniakjan Jul 2, 2024

Choose a reason for hiding this comment

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

ah, you are right, it's been a long time since I used that pattern. Looks like this was supported in controller-runtime older than 0.7.0 but is no longer an option since kubernetes-sigs/controller-runtime#1176

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.

None yet

2 participants