fluxcd / notification-controller

The GitOps Toolkit event forwarder and notification dispatcher
https://fluxcd.io
Apache License 2.0
150 stars 132 forks source link

Mattemost posts API reference isn't available to use. #840

Open agepalmist opened 3 months ago

agepalmist commented 3 months ago

Problematic: Currently, there is a chance to use Slack provider to inject Flux alerts to a Mattermost channel via a webhook. But if I want to use Mattermost API to send notifications with a Mattermost bot, like https://my_mattermost_uri/api/v4/posts it's impossible to do because of a small difference in request bodies Slack and Mattermost. Slack has the channel field to refer a message to a channel (https://api.slack.com/methods/chat.postMessage) and Mattermost has the channel_id field for this (https://api.mattermost.com/#tag/posts).

That would be useful to add channel_id to Flux Provide to handle Mattermost posts API reference also.

apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
  name: mattermost
  namespace: default
spec:
  type: slack
  #channel: general
  #address: https://slack.com/api/chat.postMessage
  channel_id: xxxxxxxxxxxxxxxxxxxxxxxxxx
  address: https://my_mattermost_uri/api/v4/posts
  secretRef:
    name: mattermost-token