diff --git a/api/v1beta1/alert_types.go b/api/v1beta1/alert_types.go index 30d3a284e..4a9693438 100644 --- a/api/v1beta1/alert_types.go +++ b/api/v1beta1/alert_types.go @@ -27,7 +27,7 @@ const ( // AlertSpec defines an alerting rule for events involving a list of objects type AlertSpec struct { - // Send events using this provider + // Send events using this provider. // +required ProviderRef meta.LocalObjectReference `json:"providerRef"` @@ -38,10 +38,14 @@ type AlertSpec struct { // +optional EventSeverity string `json:"eventSeverity,omitempty"` - // Filter events based on the involved objects + // Filter events based on the involved objects. // +required EventSources []CrossNamespaceObjectReference `json:"eventSources"` + // A list of Golang regular expressions to be used for excluding messages. + // +optional + ExclusionList []string `json:"exclusionList,omitempty"` + // Short description of the impact and affected cluster. // +optional Summary string `json:"summary,omitempty"` diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index c31060bee..e0d004c0b 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -94,6 +94,11 @@ func (in *AlertSpec) DeepCopyInto(out *AlertSpec) { *out = make([]CrossNamespaceObjectReference, len(*in)) copy(*out, *in) } + if in.ExclusionList != nil { + in, out := &in.ExclusionList, &out.ExclusionList + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertSpec. diff --git a/config/crd/bases/notification.toolkit.fluxcd.io_alerts.yaml b/config/crd/bases/notification.toolkit.fluxcd.io_alerts.yaml index 483ed1167..671d7ae15 100644 --- a/config/crd/bases/notification.toolkit.fluxcd.io_alerts.yaml +++ b/config/crd/bases/notification.toolkit.fluxcd.io_alerts.yaml @@ -56,7 +56,7 @@ spec: - error type: string eventSources: - description: Filter events based on the involved objects + description: Filter events based on the involved objects. items: description: CrossNamespaceObjectReference contains enough information to let you locate the typed referenced object at cluster level @@ -91,8 +91,14 @@ spec: - name type: object type: array + exclusionList: + description: A list of Golang regular expressions to be used for excluding + messages. + items: + type: string + type: array providerRef: - description: Send events using this provider + description: Send events using this provider. properties: name: description: Name of the referent diff --git a/docs/api/notification.md b/docs/api/notification.md index 8839d6c46..7664d35f5 100644 --- a/docs/api/notification.md +++ b/docs/api/notification.md @@ -80,7 +80,7 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
Send events using this provider
+Send events using this provider.
Filter events based on the involved objects
+Filter events based on the involved objects.
+exclusionList
A list of Golang regular expressions to be used for excluding messages.
Send events using this provider
+Send events using this provider.
Filter events based on the involved objects
+Filter events based on the involved objects.
+exclusionList
A list of Golang regular expressions to be used for excluding messages.