Commit Graph

20 Commits

Author SHA1 Message Date
Sunny eb24de9157 Set rate limiter option in test reconcilers
Set the default rate limiter configuration used in main.go in the
test reconcilers as well.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-01-18 03:45:08 +05:30
Stefan Prodan ee2600a07c Issue warning events on reconciliation errors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-09 12:05:51 +00:00
Stefan Prodan 5fd17e6220 Refactor the Receiver URL generation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-12-09 12:05:51 +00: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
Hidde Beydals 39114628a3 Update dependencies
- github.com/Azure/azure-amqp-common-go/v3 to v3.2.3
- github.com/Azure/azure-event-hubs-go/v3 to v3.3.17
- github.com/containrrr/shoutrrr to v0.5.2
- github.com/fluxcd/pkg/ssa to v0.15.1
- github.com/getsentry/sentry-go to v0.13.0
- github.com/go-logr/logr to v1.2.3
- github.com/ktrysmt/go-bitbucket to v0.9.40
- github.com/slok/go-http-metrics to v0.10.0
- github.com/xanzy/go-gitlab to v0.59.0
- golang.org/x/oauth2 to v0.0.0-20220309155454-6242fa91716a
- sigs.k8s.io/cli-utils to v0.29.3

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-18 15:22:42 +01:00
Stefan Prodan 44c08a2659
Allow disabling cross-namespace event sources
Introduce the flag `--no-cross-namespace-refs` (defaults to false) for allowing cluster admins to disable cross-namespace event sources for alerts.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-28 10:30:31 +02:00
Somtochi Onyekwere 55e1517f48 Refactor tests
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-12-03 12:47:39 +01:00
Hidde Beydals 8395bc2a5f Remove double string from Receiver ready condition
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-11-18 13:26:56 +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
Philip Laine e58fc2c96c Add rate limiter to receiver and event http servers
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2021-04-01 09:48:45 +02:00
Somtochi Onyekwere a99a0bc50d Use deepcopy method for event
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-22 09:40:16 +01:00
Michael Bridgen 8a5e0b29a8 Test filtering by exclusion list
This adds tests that the filtering by alert.Spec.ExclusionList works.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-23 12:28:20 +00:00
Michael Bridgen 956614bffe Check that events are filtered by the source
This rearranges the tests a little to make it easier to test for
events being filtered (not forwarded).

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-23 12:24:09 +00:00
Michael Bridgen 440d96487a Test case for minimal event forwarding
This adds some scaffolding for testing that events are forwarded as
specified by alerts.

The controllers themselves aren't needed; but since the
internal/server package refer directly to Kubernetes resources, the
tests share prerequisites with controller tests. For that reason I
have started by putting these tests in controllers/.

I have tried not to touch the server code itself, but it was necessary
to change it to use a fresh http.ServerMux rather than the (global)
default, so that the tests can create an event server each.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-02-23 12:17:51 +00:00
Philip Laine ed9382ec80 Upgrade controller-runtime to v0.7.0
This commit upgrades the `controller-runtime` dependency to `v0.7.0`,
including all changes required to make all wiring work again.

- Upgrade `runtime` to v0.6.0 to include `controller-runtime` changes.
- Loggers have been removed from the reconcilers and are now retrieved
  from the `context.Context` passed to the `Reconcile` method and
  downwards functions.
- Logger configuration flags are now bound to the flag set using
  `BindFlags` from `runtime/logger`, ensuring the same contract across
  GitOps Toolkit controllers, and the `--log-json` flag has been
  deprecated in favour of the `--log-encoding=json` default.
- The `ChangePredicate` from `runtime` has changed to a
  `ReconcilateAtChangedPredicate`, and is now chained with the
  `GenerationChangedPredicate` from `controller-runtime` using
  `predicate.Or`.
- The `leader-election-role` was changed, as leader election now works
  via the `coordination/v1` API.

Other notable changes:

- Use `DeletionTimestamp` of resource object to determine readiness.
- `source-controller` API dependency has been upgraded to `v0.6.0`
  which also uses `controller-runtime` `v0.7.0`.

Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Philip Laine <philip.laine@gmail.com>
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-12 15:05:54 +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
stefanprodan d90acda9e6 Promote API to v1beta1 2020-09-30 18:21:17 +03:00
stefanprodan 99fc71c17a Add receiver to API 2020-07-03 16:38:17 +03:00
stefanprodan 86c610aabf Add Alert API spec 2020-06-30 09:25:08 +03:00
stefanprodan 8f35be0055 Add Provider API spec 2020-06-30 08:57:02 +03:00