From 008c55bd9f1da164acdc8e9870ded1a0df75e1c8 Mon Sep 17 00:00:00 2001 From: Nikola Grcevski <6207777+grcevski@users.noreply.github.com> Date: Tue, 19 Oct 2021 19:27:54 -0400 Subject: [PATCH] Improve transient settings deprecation message (#79504) Update message as per docs team's suggestion. --- .../xpack/deprecation/ClusterDeprecationChecks.java | 4 ++-- .../deprecation/ClusterDeprecationChecksTests.java | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java index f3e5ca87eb8b8..63e3ee50187a7 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java @@ -14,9 +14,9 @@ public class ClusterDeprecationChecks { static DeprecationIssue checkTransientSettingsExistence(ClusterState state) { if (state.metadata().transientSettings().isEmpty() == false) { return new DeprecationIssue(DeprecationIssue.Level.WARNING, - "Transient cluster settings are in the process of being removed.", + "Transient cluster settings are deprecated", "https://ela.st/es-deprecation-7-transient-cluster-settings", - "Use persistent settings to define your cluster settings instead.", + "Use persistent settings to configure your cluster.", false, null); } diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java index abacd55a3acee..730bf691ddc10 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java @@ -18,10 +18,17 @@ public class ClusterDeprecationChecksTests extends ESTestCase { public void testCheckTransientSettingsExistence() { + Settings persistentSettings = Settings.builder() + .put("xpack.monitoring.collection.enabled", true) + .build(); + Settings transientSettings = Settings.builder() .put("indices.recovery.max_bytes_per_sec", "20mb") + .put("action.auto_create_index", true) + .put("cluster.routing.allocation.enable", "primaries") .build(); Metadata metadataWithTransientSettings = Metadata.builder() + .persistentSettings(persistentSettings) .transientSettings(transientSettings) .build(); @@ -29,13 +36,13 @@ public void testCheckTransientSettingsExistence() { DeprecationIssue issue = ClusterDeprecationChecks.checkTransientSettingsExistence(badState); assertThat(issue, equalTo( new DeprecationIssue(DeprecationIssue.Level.WARNING, - "Transient cluster settings are in the process of being removed.", + "Transient cluster settings are deprecated", "https://ela.st/es-deprecation-7-transient-cluster-settings", - "Use persistent settings to define your cluster settings instead.", + "Use persistent settings to configure your cluster.", false, null) )); - Settings persistentSettings = Settings.builder() + persistentSettings = Settings.builder() .put("indices.recovery.max_bytes_per_sec", "20mb") .build(); Metadata metadataWithoutTransientSettings = Metadata.builder()