Commit Graph

40 Commits

Author SHA1 Message Date
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 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
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
Philip Laine a98961f638 Fix error message formats
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2021-04-21 13:07:35 +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
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 f2f9960c0b Use patchStatus for alert and provider
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-29 13:25:41 +01:00
Somtochi Onyekwere c64d2c200b Return error if token is not found
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-29 12:17:14 +01:00
Somtochi Onyekwere 1f012c4206 Set observedGeneration in receivers before status update
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-27 22:27:01 +01:00
Somtochi Onyekwere d05873bdce Set observedGeneration before status update
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-27 22:01:21 +01:00
Somtochi Onyekwere af61d6ef69 Set observed generation
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-25 21:07:24 +01: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
Somtochi Onyekwere 4ae4619e23 Record suspension metrics
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-17 15:21:04 +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
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
Hidde Beydals 965ea95e7d Upgrade runtime package to v0.6.2
To include a bug fix to the `ReconcilateAtChangedPredicate`
and renaming to `ReconcileRequestedPredicate`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-14 12:55:37 +01: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
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
Stefan Prodan 9ba52a45e5
Skip alert if it's not ready
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-09 14:30:33 +02:00
Stefan Prodan 6c855a22bc
Add validation for providers and alerts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-09 12:11:22 +02: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 633f50e9c9
Implement Prometheus instrumentation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-13 15:45:53 +03:00
stefanprodan d90acda9e6 Promote API to v1beta1 2020-09-30 18:21:17 +03:00
stefanprodan d4e3755515 Implement `fluxcd/pkg/meta/api` in APIs 2020-09-30 11:33:32 +03:00
Hidde Beydals bb7c241c83 Change CRD domain 'notification.toolkit.fluxcd.io'
Due to required domain changes for the helm-controller so that it
can co-exist in a cluster with the Helm Operator, other Toolkit
components are moving to a *.toolklit.fluxcd.io domain too.
2020-07-30 22:32:07 +02:00
stefanprodan 3112e18378 Normalise controller logs
Change structure logging labels to match the controller runtime format
2020-07-15 16:02:11 +03:00
stefanprodan 201727e5af Regenerate URL when receiver token changes 2020-07-06 18:26:29 +03:00
stefanprodan 15f15bd0a9 Add samples to e2e testing 2020-07-04 11:10:17 +03:00
stefanprodan 28e8477e29 Implement GitHub receiver 2020-07-04 08:19:06 +03:00
stefanprodan 368c13af28 Implement GitRepository hook 2020-07-03 18:32:34 +03:00
stefanprodan 3c711cc5d9 Initialise receivers 2020-07-03 17:26:00 +03:00
stefanprodan 99fc71c17a Add receiver to API 2020-07-03 16:38:17 +03:00
stefanprodan c0e02990e6 Format imports 2020-07-01 17:40:33 +03:00
stefanprodan 01d5660043 Initialize resources 2020-07-01 16:35:05 +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