From db3c403ede46509a13da30074cb65518af2c9c1f Mon Sep 17 00:00:00 2001 From: Surya Sashank Nistala Date: Mon, 24 Oct 2022 19:56:16 -0700 Subject: [PATCH] fix alias exists check in findings index creation Signed-off-by: Surya Sashank Nistala --- .../main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt index c56621745..c1f14ea83 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt @@ -326,7 +326,7 @@ class AlertIndices( } val findingsIndex = dataSources.findingsIndex val findingsIndexPattern = dataSources.findingsIndexPattern ?: FINDING_HISTORY_INDEX_PATTERN - if (!clusterService.state().routingTable().hasIndex(findingsIndex)) { + if (!clusterService.state().metadata().hasAlias(findingsIndexPattern)) { createIndex( findingsIndexPattern, findingMapping(),