Address multi-cluster issue

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
pull/2639/head
Somtochi Onyekwere 3 years ago
parent ba204eb4d4
commit bd50aa2d6d

@ -14,13 +14,17 @@ There should be a dedicated kind in the notification controller for sending comm
## Motivation ## Motivation
Currently, The Alert type can reference both git providers and chat providers. However, the differences between the two providers and how notifications being sent to them should be handled has continued to diverge. Currently, The Alert type can reference both git providers and chat providers. However, the differences between the two providers and how notifications being sent to them should be handled has continued to diverge.
For example, there is a limit on the status message for git provider and sending the same notification twice overwrites the first one. For example, there is a limit on the length of the name/context of the status for git provider.
By creating a sepeerate kind for git commit status, the specific nuances of the provider can be properly taken into account. When one commit triggers more than one deployment, the commit status notification from one overwrites the other as seen in this [issue](https://github.com/fluxcd/notification-controller/issues/195).
A new field specific to the git commit status will allow Flux users to specify a prefix that will be prepended to the context to differentiate the statuses.
By creating a separate kind for git commit status, the specific nuances of the provider can be properly taken into account and it would allow more flexibility in adding fields specific to each kind.
### Goals ### Goals
- Add a new kind `CommitStatus` to Flux notification controller for handling commit status notifications. - Add a new kind `CommitStatus` to Flux notification controller for handling commit status notifications.
- Add support for sending different commit status for different environments/clusters.
### Non-Goals ### Non-Goals
@ -30,6 +34,7 @@ By creating a sepeerate kind for git commit status, the specific nuances of the
Introduce a new kind in the notification-controller called `CommitStatus`. Introduce a new kind in the notification-controller called `CommitStatus`.
The `CommitStatus` kind will similar to the `Alert` kind, referencing a provider and including event sources to accept events from. The major difference is that it will only reference git providers. Additionally, it can only have a `Kustomization` as its event source since it requires the `revision` field in the event metadata. The `CommitStatus` kind will similar to the `Alert` kind, referencing a provider and including event sources to accept events from. The major difference is that it will only reference git providers. Additionally, it can only have a `Kustomization` as its event source since it requires the `revision` field in the event metadata.
It would include a new field `.spec.prefix` that will be used to differentiate results of multiple deployments on different clusters triggered by the same commit and prevent one from overwriting the other.
This proposal will also introduce breaking changes as the `Alert` kind will no longer send notifications to git providers. This proposal will also introduce breaking changes as the `Alert` kind will no longer send notifications to git providers.
@ -50,6 +55,7 @@ spec:
eventSources: eventSources:
- kind: Kustomization - kind: Kustomization
name: webapp name: webapp
prefix: dev
``` ```
### Alternatives ### Alternatives
@ -61,3 +67,5 @@ Alternatively, we could keep using the `Alert` kind for sending notifications to
- [Implement GitHub commit status notifier](https://github.com/fluxcd/notification-controller/pull/27) - [Implement GitHub commit status notifier](https://github.com/fluxcd/notification-controller/pull/27)
- [Add Gitlab notifier](https://github.com/fluxcd/notification-controller/pull/43) - [Add Gitlab notifier](https://github.com/fluxcd/notification-controller/pull/43)
- [Add bitbucket notifier](https://github.com/fluxcd/notification-controller/pull/73) - [Add bitbucket notifier](https://github.com/fluxcd/notification-controller/pull/73)
- [Add Azure DevOps provider](https://github.com/fluxcd/notification-controller/pull/86)

Loading…
Cancel
Save