Skip to content

Commit e639036

Browse files
authored
Add assertion on removing copy_settings (elastic#30748)
The copy_settings parameter will be removed in Elasticsearch 8.0.0. This commit adds an assertion message that to clean up this code when master is bumped to 8.0.0.
1 parent ea09667 commit e639036

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.rest.action.admin.indices;
2121

22+
import org.elasticsearch.Version;
2223
import org.elasticsearch.action.admin.indices.shrink.ResizeRequest;
2324
import org.elasticsearch.action.admin.indices.shrink.ResizeType;
2425
import org.elasticsearch.action.support.ActiveShardCount;
@@ -47,6 +48,8 @@ public abstract class RestResizeHandler extends BaseRestHandler {
4748
public final RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
4849
final ResizeRequest resizeRequest = new ResizeRequest(request.param("target"), request.param("index"));
4950
resizeRequest.setResizeType(getResizeType());
51+
// copy_settings should be removed in Elasticsearch 8.0.0; cf. https://github.com/elastic/elasticsearch/issues/28347
52+
assert Version.CURRENT.major < 8;
5053
final String rawCopySettings = request.param("copy_settings");
5154
final Boolean copySettings;
5255
if (rawCopySettings == null) {

0 commit comments

Comments
 (0)