From eaa791475961bc1e231ae98842cf0e24be8cdbfc Mon Sep 17 00:00:00 2001 From: Surya Sashank Nistala Date: Sun, 9 Jul 2023 21:07:15 -0700 Subject: [PATCH] add audit state check in error alert validation Signed-off-by: Surya Sashank Nistala --- src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt index d2b945c8..4c63a07c 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt @@ -46,7 +46,7 @@ data class Alert( ) : Writeable, ToXContent { init { - if (errorMessage != null) require(state == State.DELETED || state == State.ERROR || state == State.DELETED) { + if (errorMessage != null) require(state == State.DELETED || state == State.ERROR || state == State.AUDIT) { "Attempt to create an alert with an error in state: $state" } }