From 046652cee41f3fcb26a4e29ad1cf32e06a7b4d22 Mon Sep 17 00:00:00 2001 From: Swetha Guptha Date: Sat, 26 Oct 2024 09:25:07 +0530 Subject: [PATCH] Fix repo prefix. Signed-off-by: Swetha Guptha --- .../RemoteStoreBaseIntegTestCase.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreBaseIntegTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreBaseIntegTestCase.java index bcb0d54c0a25c..f979134332c8b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreBaseIntegTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreBaseIntegTestCase.java @@ -61,8 +61,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX; -import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT; +import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX; +import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT; import static org.opensearch.repositories.fs.ReloadableFsRepository.REPOSITORIES_FAILRATE_SETTING; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; @@ -267,9 +267,17 @@ public void teardown() { public RepositoryMetadata buildRepositoryMetadata(DiscoveryNode node, String name) { Map nodeAttributes = node.getAttributes(); - String type = nodeAttributes.get(String.format(Locale.getDefault(), REMOTE_STORE_REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, name)); - - String settingsAttributeKeyPrefix = String.format(Locale.getDefault(), REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, name); + String remotePublicationPrefix = "remote_publication"; + String type = nodeAttributes.get( + String.format(Locale.getDefault(), REPOSITORY_TYPE_ATTRIBUTE_KEY_FORMAT, remotePublicationPrefix, name) + ); + + String settingsAttributeKeyPrefix = String.format( + Locale.getDefault(), + REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX, + remotePublicationPrefix, + name + ); Map settingsMap = node.getAttributes() .keySet() .stream()