fluxcd / notification-controller

The GitOps Toolkit event forwarded and notification dispatcher

Home Page:https://fluxcd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow 'all namespaces' in eventSources

jpflouret opened this issue · comments

Currently CrossNamespaceObjectReference can match 'all resources' in a given namespace using the resource name *. However, it is not seem possible to match 'all resources' on 'all namespaces'.

I have an Alert that I'd like to handle all event sources of type HelmRelease on any namespace. Currently I have to enumerate all namespaces that have HelmReleases on them:

---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
  name: slack-helm
  namespace: flux-system
spec:
  providerRef:
    name: slack-bot
  eventSeverity: info
  eventSources:
    - kind: HelmRelease
      name: '*'
      namespace: namespace-a
    - kind: HelmRelease
      name: '*'
      namespace: namespace-b
    - kind: HelmRelease
      name: '*'
      namespace: namespace-c
      # ...

Ideally I could specify 'all namespaces' with *:

---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
  name: slack-helm
  namespace: flux-system
spec:
  providerRef:
    name: slack-bot
  eventSeverity: info
  eventSources:
    - kind: HelmRelease
      name: '*'
      namespace: '*'

Seems like it would be a relatively small change in eventMatchesAlertSource