From e54b825302f29f82289d2985d448b9be155404d4 Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Wed, 21 Jun 2023 09:10:17 +0200 Subject: [PATCH] [Profiling] Use descriptive name for ILM policy With this commit we rename the default ILM policy for profiling from `profiling` to `profiling-60-days` which describes the policy's intention and allows to add related policies in the future more naturally. --- .../xpack/profiler/ProfilingIndexTemplateRegistry.java | 2 +- .../xpack/profiler/ProfilingIndexTemplateRegistryTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/profiler/src/main/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistry.java b/x-pack/plugin/profiler/src/main/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistry.java index d4727a988fa00..99ef6f74196fc 100644 --- a/x-pack/plugin/profiler/src/main/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistry.java +++ b/x-pack/plugin/profiler/src/main/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistry.java @@ -75,7 +75,7 @@ protected boolean requiresMasterNode() { private static final List LIFECYCLE_POLICIES = List.of( new LifecyclePolicyConfig( - "profiling", + "profiling-60-days", "/org/elasticsearch/xpack/profiler/ilm-policy/profiling-60-days.json", Map.of(PROFILING_TEMPLATE_VERSION_VARIABLE, String.valueOf(INDEX_TEMPLATE_VERSION)) ).load(LifecyclePolicyConfig.DEFAULT_X_CONTENT_REGISTRY) diff --git a/x-pack/plugin/profiler/src/test/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistryTests.java b/x-pack/plugin/profiler/src/test/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistryTests.java index 518b65f146e37..64601d1055cec 100644 --- a/x-pack/plugin/profiler/src/test/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistryTests.java +++ b/x-pack/plugin/profiler/src/test/java/org/elasticsearch/xpack/profiler/ProfilingIndexTemplateRegistryTests.java @@ -139,7 +139,7 @@ public void testThatNonExistingPoliciesAreAddedImmediately() throws Exception { assertThat(action, instanceOf(PutLifecycleAction.class)); assertThat(request, instanceOf(PutLifecycleAction.Request.class)); final PutLifecycleAction.Request putRequest = (PutLifecycleAction.Request) request; - assertThat(putRequest.getPolicy().getName(), equalTo("profiling")); + assertThat(putRequest.getPolicy().getName(), equalTo("profiling-60-days")); assertNotNull(listener); return AcknowledgedResponse.TRUE; } else if (action instanceof PutComponentTemplateAction) { @@ -273,7 +273,7 @@ public void testPolicyUpgraded() throws Exception { assertThat(action, instanceOf(PutLifecycleAction.class)); assertThat(request, instanceOf(PutLifecycleAction.Request.class)); final PutLifecycleAction.Request putRequest = (PutLifecycleAction.Request) request; - assertThat(putRequest.getPolicy().getName(), equalTo("profiling")); + assertThat(putRequest.getPolicy().getName(), equalTo("profiling-60-days")); assertNotNull(listener); return AcknowledgedResponse.TRUE;