-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat: support multi receiver by matchLabels #482
Conversation
b455609
to
efcff60
Compare
f8b1720
to
3a7a8ca
Compare
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.
I don't understand how this is supposed to work. The .name
field is still mandatory and this PR doesn't change the way it is handled. The PR description says you can set name
to *
the same way we support it with Alerts but the commits don't back this up.
In fact, name
is still used to fetch a single resource and in addition matchLabels
is taken into account as well.
Hey please align on your side and decide what you want, #482 (comment) |
I see 2 issues with the details of this PR:
A solution would be to accept
But then the question arises of how we handle |
I will change it back then. That's what I suggested in the first place.
Either we can can change it so if no matchLabels are set and its
Well thats the case which is covered if I change it back how it was initially.
This would require a validation hook I reckon. But this is also possible in Alert actually. You currently can set match labels while name is not |
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.
This looks much better now. Just some suggestions and please also update docs/api/notification.md to reflect the changes around the semantics of .spec.resources
.
8f69751
to
1ae0f47
Compare
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.
Just a last nit. Otherwise lgtm.
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.
I think we have everything in place right now. Good job, @raffis. 🎖️
Please squash all your commits into one, then I'll make sure to get it merged.
Signed-off-by: Raffael Sahli <[email protected]>
036a521
to
57f62f4
Compare
Done, thx for the review 🥇 |
@somtochiama mind to take a final look, please? 🙏🏻 |
Holding for next minor release. |
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.
LGTM!
Thanks @raffis 🚀
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.
I'm sorry @raffis but I need to ask for one additional change: Please document the changed API in https://github.com/fluxcd/notification-controller/blob/main/docs/spec/v1beta2/receivers.md#resources. The content of that page is published at https://fluxcd.io/flux/components/notification/receiver/ so we need give clear guidance on how to use matchLabels
.
Signed-off-by: Somtochi Onyekwere <[email protected]>
Signed-off-by: Raffael Sahli <[email protected]>
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.
LGTM
Thanks @raffis 🏅
This has been introduced in #482 but we actually want this feature to only be available in v1 of the API. A follow-up PR will re-add this to the v1 API. Signed-off-by: Max Jonas Werner <[email protected]>
This has been introduced in #482 but we actually want this feature to only be available in v1 of the API. A follow-up PR will re-add this to the v1 API. Signed-off-by: Max Jonas Werner <[email protected]>
This functionality has been implemented in #482 but we only want to expose it in v1 of the API. Signed-off-by: Max Jonas Werner <[email protected]>
This functionality has been implemented in #482 but we only want to expose it in v1 of the API. Signed-off-by: Max Jonas Werner <[email protected]>
This functionality has been implemented in #482 but we only want to expose it in v1 of the API. Signed-off-by: Max Jonas Werner <[email protected]>
This has been introduced in fluxcd#482 but we actually want this feature to only be available in v1 of the API. A follow-up PR will re-add this to the v1 API. Signed-off-by: Max Jonas Werner <[email protected]>
This functionality has been implemented in fluxcd#482 but we only want to expose it in v1 of the API. Signed-off-by: Max Jonas Werner <[email protected]>
Current situation
At the moment one has to reference each resource by name for a webhook receiver.
While spec.resources actually is a
CrossNamespaceObjectReference
which supports matchLabels. However this is not implemented in the internal handling of the receiver. What I like to achieve is basically trigger a reconcile for multiple HelmCharts matching a certain label (or just all of them in a specific namespace).This currently is unsupported in the reconcile logic while it is supported in the api:
Background
I like to send a webhook from github for helm packages published in ghcr. The receiver should reconcile all (or matching helm charts by label) charts and trigger a reconcile.
What I am trying to avoid is set a very low interval but instead reconcile a helmrelease immediately if a new version is published via webhook.
This works perfectly fine already but I would need to specify each chart manually in the list of resources.
Proposal
Support matchLabels and
*
as name the same way as this is already supported for Alerts in the notification-controller.