Commit Graph

52 Commits

Author SHA1 Message Date
Max Jonas Werner ec03bd20a3
Introduce v1 API and bump Receiver version to v1
This commit bumps the Receiver API version to v1 in preparation of
the Flux GitOps GA milestone
(https://fluxcd.io/roadmap/#flux-gitops-ga-q1-2023).

We are now actively maintaining two versions of the notification API
group in parallel: v1 which currently only holds the Receiver kind and
v1beta2 for all other kinds.

Since we haven't run into this situation before, I had to change the
way we expose the API docs in ./docs/api: The directory now has
sub-directories for each active API version. Therefore we need to
change our scripts in the website repository to take this change into
account so that we expose both API group version at
https://fluxcd.io/flux/components/notification/api/. This change is
implemented in https://github.com/fluxcd/website/pull/1427.

refs #436

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-03-30 15:40:54 +02:00
Stefan Prodan 974a77da00 Refactor reconcilers and introduce v1beta2 API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-09 11:03:53 +00:00
Max Jonas Werner a76b9a0c63
Add "generic-hmac" Provider
This commit adds the "generic-hmac" Provider type for authenticating
webhook requests coming from notification-controller. I extended the
`Forwarder` notifier to accept an optional key used for generating the
HMAC. If the key is nil or empty no HMAC header is generated and the
forwarder behaves as before. If it is provided an `X-Signature` HTTP
header is added to the request carrying the HMAC.

I transformed the `TestForwarder_Post` test into a table-driven test
so that we can use the same setup and testing code for testing HMAC
and non-HMAC forwarder instances.

Any existing `X-Signature` header value set through
a `Provider.spec.secretRef` Secret's `header` field will be
overwritten.

closes #99

Signed-off-by: Max Jonas Werner <max@e13.dev>
2022-10-04 18:41:45 +02:00
Stefan Prodan b225c77185
api: add custom validation for v1.Duration types
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-20 12:14:39 +03:00
Somtochi Onyekwere 071dda5e97 Add finalizers to all the CRDs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-09-09 15:18:11 +01:00
Somtochi Onyekwere 25eeaf46dd Add .spec.timeout to Provider
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-31 11:25:09 +01:00
Sunny 8fac504e6b
Add OCIRepository event source kind
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-08-03 17:25:56 +05:30
Aleksey Pogibelev 627eeba201 add github dispatch provider
Signed-off-by: Aleksey Pogibelev <aleksey.pogibelev@gmail.com>
2022-04-21 14:49:20 +03:00
Sunny 16c1d7e042
api: Move Status in CRD printcolumn to the end
Status content could be very long compare to other fields. Moving it to
the end helps improve the visibility of other fields.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 02:12:36 +05:30
Somtochi Onyekwere 519b6a5c5c Add LabelSelectors for Event Sources
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-10 11:09:39 +01:00
Filipe Sequeira 659c01f70e Add support for Grafana annotations API
Signed-off-by: Filipe Sequeira <filipe@weave.works>
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-08 11:10:14 +00:00
Aurel Canciu ae2bdbae0b
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-12-15 18:39:43 +01:00
Somtochi Onyekwere 7f66d3983b Bump observed generation only once
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-08 23:23:07 +01:00
Somtochi Onyekwere 19a0daa906 Use conditions helper in reconciler
Co-authored-by: Piaras Hoban <piaras@weave.works>
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Co-authored-by: souleb <bah.soule@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-11-01 14:20:12 +01:00
Stefan Prodan b1060df96f
Merge pull request #258 from Alan01252/feature/alertmanager
Add alertmanager provider
2021-10-19 14:14:57 +03:00
Alan Hollis 8bf81500d3 Add alertmanager provider
This commit adds the alertmanager provider. The provider adds some
generic labels based on the event which should be enough to configure
appropraite routes within alertmanager.

The alert is annotated with the message by default and optionally by the
summary field given in the event.

Signed-off-by: Alan Hollis <me@alanhollis.com>
2021-10-13 12:48:51 +01:00
Somtochi Onyekwere 209d01e92e Set observed generation when recording status
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-13 10:22:19 +01:00
Alan Hollis cbe52b505a Add opsgenie provider
Signed-off-by: Alan Hollis <me@alanhollis.com>
2021-10-06 14:14:54 +01:00
Max Jonas Werner 2d55e609fa
feat: set default observedGeneration to -1 on CRDs
This sets the `status.observedGeneration` field to -1 by default. This
is a follow-up to https://github.com/fluxcd/helm-controller/pull/294,
porting the same code to the notification-controller so that all Flux
2 controllers work the same way in this regard.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-08-27 17:18:38 +02:00
Somtochi Onyekwere 61103fc19a Add support for Matrix notification
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-08-26 10:21:50 +01:00
Somtochi Onyekwere 4893803b24 Add lark type
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-08-25 10:17:21 +01:00
Somtochi Onyekwere b0563cbd15 Send notifications using telegram
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-08-19 08:17:07 +01:00
Edvin Norling e019aaab34 Change to azureeventhub
* Update go.sum
* Use ctx with timeout
* minor linting & clean-up

Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2021-05-05 11:01:51 +02:00
Edvin Norling 6ffa2e91fe Add support for Azure EventHub provider
Solves #190

Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2021-05-05 11:01:51 +02:00
Philip Laine 8f3b685f17 Add self signed cert to provider
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2021-04-15 00:08:59 +02:00
Stefan Prodan daaaf30ce1
Merge pull request #171 from SomtochiAma/observed-gen
Add observedGeneration to status of alert and receivers
2021-03-29 15:45:01 +03:00
LWJ 75d6dc4c31 Add support for Sentry provider
Signed-off-by: LWJ <lwjames1996@gmail.com>
2021-03-26 23:36:52 +00:00
Somtochi Onyekwere 71bbb3cf82 Add observedGeneration to status of alert and receivers
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-25 15:55:27 +01:00
Grant Doctor 01bacccb44 adding support for webex as an alert provider
Signed-off-by: Grant Doctor <gdoctor@cisco.com>
2021-03-22 14:54:04 -07:00
Somtochi Onyekwere 4a68a61289 add acr webhook
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-05 12:34:11 +01:00
Darren Everley 3ba3cf8cc1 Added missing factory method.
Signed-off-by: Darren Everley <darren.everley@xeropoint.co.uk>
2021-03-01 10:23:18 +00:00
Darren Everley 07ea112d02 Correction for missing there was a code generation phase and originally making the change to the generated artefact.
Signed-off-by: Darren Everley <darren.everley@xeropoint.co.uk>
2021-02-27 18:08:24 +00:00
Stefan Prodan 5c9e95ca02
Implement regex exclusions for alerts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-08 15:45:11 +02:00
Somtochi Onyekwere ed33ef85cc Add kinds to api types
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-25 23:43:24 +01:00
Stefan Prodan dff79355ec
Update fluxcd/pkg/runtime to v0.8.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-22 10:23:47 +02:00
Michael Bridgen 4687dd79ad Add ImagePolicy to allowed object ref kinds
As with ImageUpdateAutomation, it's useful to allow alerts to process
events from ImagePolicy objects. Letting them be the target of webhook
triggers is not useful, since they don't support the reconcile request
protocol -- but is better than making a special case for them.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-21 13:22:18 +00:00
Michael Bridgen b927be3263 Allow ImageUpdateAutomations in object refs
This adds ImageUpdateAutomation as a kind allowed by cross-namespace
object references here. That has two effects:

 - ImageUpdateAutomation objects can be the source of events; and,
 - ImageUpdateAutomation objects can be the target of webhook
   triggers.

Of these, the first is certainly desirable (e.g,. now you can post a
Slack message when automation fails). The second may be useful, though
automations will more usually be triggered by ImageRepository objects
changing, and anyway doesn't hurt.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-21 13:20:14 +00:00
Somtochi Onyekwere f9fc7292b3 Add generic-hmac implementation
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-21 09:12:01 +01:00
Somtochi Onyekwere 6f299d5229 Add webhook for nexus
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-20 12:40:17 +01:00
Somtochi Onyekwere 07bca13213 Adds gcr notification webhook
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-18 12:09:24 +01:00
Somtochi Onyekwere 201fb66617 add quay webhook
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-01-15 13:37:58 +01:00
Stefan Prodan 4e63d79514
Implement DockerHub webhook receiver
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-14 16:57:31 +02:00
Stefan Prodan c148d6a036
Trigger ImageRepository reconciliation with webhook receivers
- Add ImageRepository to the Receiver API known kinds and RBAC
- Trigger container image updates to Git by annotating ImageRepository objects

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-14 14:16:13 +02:00
Joshua Mühlfort 57e243d9ff Add hint about used "address" data key to the Provider CRD's SecretRef
Signed-off-by: Joshua Mühlfort <muehlfort@gonicus.de>
2021-01-06 13:04:08 +01:00
Stefan Prodan f2e96a88e0
Add summary field to Alert API
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-06 11:36:41 +02:00
Philip Laine 4922ddee15 Add Azure DevOps provider
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-11-22 15:07:56 +01:00
Aurel Canciu ce214b9fa9
Refactor to adopt k8s standardized Condition type
Updates to use metav1.Condition type and removes references for
deprecated corev1.Condition* constants and uses the new k8s api/meta
helpers in place of the old pkg/apis/meta types.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-11-19 19:51:40 +02:00
Philip Laine 030a0f6ed8 Add bitbucket notifier
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-11-07 23:20:36 +01:00
Stefan Prodan 2437884a97
Change copyright to Flux authors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-27 18:52:14 +02:00
Stefan Prodan 46666dae22
Add URL prefix validation to CRDs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-17 15:58:49 +03:00