Skip to content

Commit e02283f

Browse files
committed
Add reindex_required flag to index version deprecation notice response
1 parent 07265aa commit e02283f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
2121

2222
import java.util.ArrayList;
23+
import java.util.Collections;
2324
import java.util.List;
2425
import java.util.Locale;
2526
import java.util.Map;
@@ -43,7 +44,7 @@ static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata, ClusterStat
4344
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
4445
"This index has version: " + currentCompatibilityVersion.toReleaseVersion(),
4546
false,
46-
null
47+
Collections.singletonMap("reindex_required", true)
4748
);
4849
}
4950
return null;

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.Map;
3030

3131
import static java.util.Collections.singletonList;
32+
import static java.util.Collections.singletonMap;
3233
import static org.elasticsearch.xpack.deprecation.DeprecationChecks.INDEX_SETTINGS_CHECKS;
3334
import static org.hamcrest.Matchers.empty;
3435
import static org.hamcrest.Matchers.equalTo;
@@ -52,7 +53,7 @@ public void testOldIndicesCheck() {
5253
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
5354
"This index has version: " + createdWith.toReleaseVersion(),
5455
false,
55-
null
56+
singletonMap("reindex_required", true)
5657
);
5758
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS, c -> c.apply(indexMetadata, clusterState));
5859
assertEquals(singletonList(expected), issues);

0 commit comments

Comments
 (0)