Add summary field to Alert API

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2020-12-06 11:36:41 +02:00
parent d9659be015
commit f2e96a88e0
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
4 changed files with 53 additions and 0 deletions

View File

@ -38,6 +38,10 @@ type AlertSpec struct {
// +required
EventSources []CrossNamespaceObjectReference `json:"eventSources"`
// Short description of the impact and affected cluster.
// +optional
Summary string `json:"summary,omitempty"`
// This flag tells the controller to suspend subsequent events dispatching.
// Defaults to false.
// +optional

View File

@ -96,6 +96,9 @@ spec:
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
summary:
description: Short description of the impact and affected cluster.
type: string
suspend:
description: This flag tells the controller to suspend subsequent
events dispatching. Defaults to false.

View File

@ -113,6 +113,18 @@ If set to &lsquo;info&rsquo; no events will be filtered.</p>
</tr>
<tr>
<td>
<code>summary</code><br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Short description of the impact and affected cluster.</p>
</td>
</tr>
<tr>
<td>
<code>suspend</code><br>
<em>
bool
@ -491,6 +503,18 @@ If set to &lsquo;info&rsquo; no events will be filtered.</p>
</tr>
<tr>
<td>
<code>summary</code><br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Short description of the impact and affected cluster.</p>
</td>
</tr>
<tr>
<td>
<code>suspend</code><br>
<em>
bool

View File

@ -21,6 +21,10 @@ type AlertSpec struct {
// +required
EventSources []CrossNamespaceObjectReference `json:"eventSources"`
// Short description of the impact and affected cluster.
// +optional
Summary string `json:"summary,omitempty"`
// This flag tells the controller to suspend subsequent events dispatching.
// Defaults to false.
// +optional
@ -93,3 +97,21 @@ spec:
```
If you don't specify an event source namespace, the alert namespace will be used.
You can add a summary to describe the impact of an event:
```yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
name: ingress
namespace: nginx
spec:
summary: "Ingress traffic affected in production (us-west-2)"
providerRef:
name: on-call-slack
eventSeverity: error
eventSources:
- kind: HelmRelease
name: nginx-ingress
```