From 30a9e56edacaab03264e9bb5cd5d98cfe327e378 Mon Sep 17 00:00:00 2001 From: tender_barbarian Date: Wed, 24 Sep 2025 13:52:36 +0200 Subject: [PATCH] fix: don't call Alias API if aliasActions are empty If index has only a single alias that has been rolled over on, copyAlias() throws exception, becuse it tries to call Alias API with empty actions param. Signed-off-by: tender_barbarian --- .../step/rollover/AttemptRolloverStep.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt index c5e2c3d30..58a768d16 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt @@ -330,6 +330,11 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { .isHidden(aliasMetadata.isHidden) aliasActions.add(aliasAction) } + + if (aliasActions.isEmpty()) { + return + } + val aliasReq = IndicesAliasesRequest() aliasActions.forEach { aliasReq.addAliasAction(it) }