From 21ce59b2f6a3c4e6fbf743f87ca612a257833bb3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 00:32:08 -0700 Subject: [PATCH] fix alias exists check in findings index creation (#622) (#623) 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(),