From 89c743ae0ba22d4368a97e68471a1a15f2185452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=BC=C3=9F?= Date: Fri, 10 May 2024 13:00:16 +0200 Subject: [PATCH] feat: add KeepLast as valid value for no data & exec err state implements #1513 --- api/v1beta1/grafanaalertrulegroup_types.go | 4 ++-- .../bases/grafana.integreatly.org_grafanaalertrulegroups.yaml | 2 ++ config/grafana.integreatly.org_grafanaalertrulegroups.yaml | 2 ++ .../crds/grafana.integreatly.org_grafanaalertrulegroups.yaml | 2 ++ deploy/kustomize/base/crds.yaml | 2 ++ docs/docs/api.md | 4 ++-- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/v1beta1/grafanaalertrulegroup_types.go b/api/v1beta1/grafanaalertrulegroup_types.go index 733e94b69..69c5b60c1 100644 --- a/api/v1beta1/grafanaalertrulegroup_types.go +++ b/api/v1beta1/grafanaalertrulegroup_types.go @@ -64,7 +64,7 @@ type AlertRule struct { // +kubebuilder:validation:Required Data []*AlertQuery `json:"data"` - // +kubebuilder:validation:Enum=OK;Alerting;Error + // +kubebuilder:validation:Enum=OK;Alerting;Error;KeepLast ExecErrState string `json:"execErrState"` // +kubebuilder:validation:Type=string @@ -77,7 +77,7 @@ type AlertRule struct { Labels map[string]string `json:"labels,omitempty"` - // +kubebuilder:validation:Enum=Alerting;NoData;OK + // +kubebuilder:validation:Enum=Alerting;NoData;OK;KeepLast NoDataState *string `json:"noDataState"` // +kubebuilder:validation:MinLength=1 diff --git a/config/crd/bases/grafana.integreatly.org_grafanaalertrulegroups.yaml b/config/crd/bases/grafana.integreatly.org_grafanaalertrulegroups.yaml index 700aeb711..270fee076 100644 --- a/config/crd/bases/grafana.integreatly.org_grafanaalertrulegroups.yaml +++ b/config/crd/bases/grafana.integreatly.org_grafanaalertrulegroups.yaml @@ -106,6 +106,7 @@ spec: - OK - Alerting - Error + - KeepLast type: string for: format: duration @@ -122,6 +123,7 @@ spec: - Alerting - NoData - OK + - KeepLast type: string title: example: Always firing diff --git a/config/grafana.integreatly.org_grafanaalertrulegroups.yaml b/config/grafana.integreatly.org_grafanaalertrulegroups.yaml index 877a497d3..70551ce04 100644 --- a/config/grafana.integreatly.org_grafanaalertrulegroups.yaml +++ b/config/grafana.integreatly.org_grafanaalertrulegroups.yaml @@ -159,6 +159,7 @@ spec: - OK - Alerting - Error + - KeepLast type: string for: format: duration @@ -175,6 +176,7 @@ spec: - Alerting - NoData - OK + - KeepLast type: string title: example: Always firing diff --git a/deploy/helm/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml b/deploy/helm/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml index 700aeb711..270fee076 100644 --- a/deploy/helm/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml +++ b/deploy/helm/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml @@ -106,6 +106,7 @@ spec: - OK - Alerting - Error + - KeepLast type: string for: format: duration @@ -122,6 +123,7 @@ spec: - Alerting - NoData - OK + - KeepLast type: string title: example: Always firing diff --git a/deploy/kustomize/base/crds.yaml b/deploy/kustomize/base/crds.yaml index f2fb77dba..03d9dff91 100644 --- a/deploy/kustomize/base/crds.yaml +++ b/deploy/kustomize/base/crds.yaml @@ -105,6 +105,7 @@ spec: - OK - Alerting - Error + - KeepLast type: string for: format: duration @@ -121,6 +122,7 @@ spec: - Alerting - NoData - OK + - KeepLast type: string title: example: Always firing diff --git a/docs/docs/api.md b/docs/docs/api.md index bb9cea82d..90a478dd0 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -277,7 +277,7 @@ AlertRule defines a specific rule to be evaluated. It is based on the upstream m

- Enum: OK, Alerting, Error
+ Enum: OK, Alerting, Error, KeepLast
true @@ -295,7 +295,7 @@ AlertRule defines a specific rule to be evaluated. It is based on the upstream m

- Enum: Alerting, NoData, OK
+ Enum: Alerting, NoData, OK, KeepLast
true