mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 06:25:07 +00:00
Properly set origin for SLM history store client (#45515)
The origin was not set properly for the SnapshotHistoryStore client, resulting in errors when SLM was used when security was enabled.
This commit is contained in:
parent
bba7017262
commit
3f5dab99c3
@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchException;
|
|||||||
import org.elasticsearch.action.ActionRequest;
|
import org.elasticsearch.action.ActionRequest;
|
||||||
import org.elasticsearch.action.ActionResponse;
|
import org.elasticsearch.action.ActionResponse;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
|
import org.elasticsearch.client.OriginSettingClient;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||||
import org.elasticsearch.cluster.metadata.MetaData;
|
import org.elasticsearch.cluster.metadata.MetaData;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
@ -108,6 +109,7 @@ import java.util.List;
|
|||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import static java.util.Collections.emptyList;
|
import static java.util.Collections.emptyList;
|
||||||
|
import static org.elasticsearch.xpack.core.ClientHelper.INDEX_LIFECYCLE_ORIGIN;
|
||||||
|
|
||||||
public class IndexLifecycle extends Plugin implements ActionPlugin {
|
public class IndexLifecycle extends Plugin implements ActionPlugin {
|
||||||
private final SetOnce<IndexLifecycleService> indexLifecycleInitialisationService = new SetOnce<>();
|
private final SetOnce<IndexLifecycleService> indexLifecycleInitialisationService = new SetOnce<>();
|
||||||
@ -162,7 +164,8 @@ public class IndexLifecycle extends Plugin implements ActionPlugin {
|
|||||||
getClock(), System::currentTimeMillis, xContentRegistry));
|
getClock(), System::currentTimeMillis, xContentRegistry));
|
||||||
SnapshotLifecycleTemplateRegistry templateRegistry = new SnapshotLifecycleTemplateRegistry(settings, clusterService, threadPool,
|
SnapshotLifecycleTemplateRegistry templateRegistry = new SnapshotLifecycleTemplateRegistry(settings, clusterService, threadPool,
|
||||||
client, xContentRegistry);
|
client, xContentRegistry);
|
||||||
snapshotHistoryStore.set(new SnapshotHistoryStore(settings, client, getClock().getZone()));
|
snapshotHistoryStore.set(new SnapshotHistoryStore(settings, new OriginSettingClient(client, INDEX_LIFECYCLE_ORIGIN),
|
||||||
|
getClock().getZone()));
|
||||||
snapshotLifecycleService.set(new SnapshotLifecycleService(settings,
|
snapshotLifecycleService.set(new SnapshotLifecycleService(settings,
|
||||||
() -> new SnapshotLifecycleTask(client, clusterService, snapshotHistoryStore.get()), clusterService, getClock()));
|
() -> new SnapshotLifecycleTask(client, clusterService, snapshotHistoryStore.get()), clusterService, getClock()));
|
||||||
return Arrays.asList(indexLifecycleInitialisationService.get(), snapshotLifecycleService.get(), snapshotHistoryStore.get());
|
return Arrays.asList(indexLifecycleInitialisationService.get(), snapshotLifecycleService.get(), snapshotHistoryStore.get());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user