Skip to content

Commit

Permalink
Improve transient settings deprecation message (elastic#79504)
Browse files Browse the repository at this point in the history
Update message as per docs team's suggestion.
  • Loading branch information
grcevski authored Oct 19, 2021
1 parent 541a4fd commit 008c55b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,31 @@
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();

ClusterState badState = ClusterState.builder(new ClusterName("test")).metadata(metadataWithTransientSettings).build();
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()
Expand Down

0 comments on commit 008c55b

Please sign in to comment.