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>
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>
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>
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>
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>
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>
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>
- 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>
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>