Skip to content

Commit

Permalink
Fix issue with readonly indices after bugfix in core (opensearch-proj…
Browse files Browse the repository at this point in the history
…ect/OpenSearch#16568)

Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 6, 2024
1 parent bed7788 commit 295530f
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,27 @@ constructor(
updateSettingReqsList.add(
UpdateSettingsRequest().indices(*readOnlyIndices.map { indices[it] }.toTypedArray())
.settings(
Settings.builder().put(ManagedIndexSettings.AUTO_MANAGE.key, false)
.put(INDEX_READ_ONLY_SETTING.key, true),
Settings.builder().put(INDEX_READ_ONLY_SETTING.key, false),
),
)
updateSettingReqsList.add(
UpdateSettingsRequest().indices(*readOnlyIndices.map { indices[it] }.toTypedArray())
.settings(
Settings.builder().put(ManagedIndexSettings.AUTO_MANAGE.key, false).put(INDEX_READ_ONLY_SETTING.key, true),
),
)
}
if (readOnlyAllowDeleteIndices.isNotEmpty()) {
updateSettingReqsList.add(
UpdateSettingsRequest().indices(*readOnlyAllowDeleteIndices.map { indices[it] }.toTypedArray())
.settings(
Settings.builder().put(ManagedIndexSettings.AUTO_MANAGE.key, false)
.put(INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING.key, true),
Settings.builder().put(INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING.key, false),
),
)
updateSettingReqsList.add(
UpdateSettingsRequest().indices(*readOnlyAllowDeleteIndices.map { indices[it] }.toTypedArray())
.settings(
Settings.builder().put(ManagedIndexSettings.AUTO_MANAGE.key, false).put(INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING.key, true),
),
)
}
Expand Down

0 comments on commit 295530f

Please sign in to comment.