notification-controller icon indicating copy to clipboard operation
notification-controller copied to clipboard

Allow 'all namespaces' in eventSources

Open jpflouret opened this issue 11 months ago • 1 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

jpflouret avatar Apr 01 '24 23:04 jpflouret