fluxcd / notification-controller

The GitOps Toolkit event forwarder and notification dispatcher

Home Page:https://fluxcd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request - exclusionList in Alert should filter on more than just the message

philipsabri opened this issue · comments

Hello! Currently running into a few problems with more "complex" Alert configs.

Would be nice if we could use exclusionList on more than just the message such as the name of the alert, which I believe is called event.InvolvedObject.Name

I would like to run something like this without having to hardcore all services in eventSources for the first Alert config but still be able to add more customizable slack messages on only some services.

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
  name: service-deploy
  namespace: flux-system
spec:
  summary: "HelmRelease deploys"
  providerRef:
    name: slack-service-deploy
  eventSeverity: info
  eventSources:
    - kind: HelmRelease
      name: "*"
  exclusionList:
    - ".*flurrens-service.*"
---
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
  name: service-deploy-flurren
  namespace: flux-system
spec:
  summary: "tex text notify owner <@SLACK_ID_HERE>"
  providerRef:
    name: slack-service-deploy
  eventSeverity: info
  eventSources:
    - kind: HelmRelease
      name: "*"
      matchLabels:
        owner: flurren

Made a PR if this could be something #419 I dont know GO so it could probably be done in other ways.