feat: support multi receiver by matchLabels#482
Conversation
b455609 to
efcff60
Compare
f8b1720 to
3a7a8ca
Compare
makkes
left a comment
There was a problem hiding this comment.
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 |
makkes
left a comment
There was a problem hiding this comment.
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
makkes
left a comment
There was a problem hiding this comment.
Just a last nit. Otherwise lgtm.
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
036a521 to
57f62f4
Compare
Done, thx for the review 🥇 |
|
@somtochiama mind to take a final look, please? 🙏🏻 |
|
Holding for next minor release. |
makkes
left a comment
There was a problem hiding this comment.
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 <somtochionyekwere@gmail.com>
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
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 <mail@makk.es>
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 <mail@makk.es>
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 <mail@makk.es>
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 <mail@makk.es>
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 <mail@makk.es>
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 <mail@makk.es>
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 <mail@makk.es>
Current situation
At the moment one has to reference each resource by name for a webhook receiver.
While spec.resources actually is a
CrossNamespaceObjectReferencewhich 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.