Skip to content

Conversation

@jtibshirani
Copy link
Contributor

The template field was deprecated in 6.0 in favor of index_patterns, and can
now be removed.

Relates to #21009.

The `template` field was deprecated in 6.0 in favor of `index_patterns`, and can
now be removed.
@jtibshirani jtibshirani added >breaking :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 labels Nov 21, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

patterns(Collections.singletonList((String) entry.getValue()));
}
} else if (name.equals("index_patterns")) {
if (name.equals("index_patterns")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hard break -- users who specified template in the source would not have seen a deprecation warning about it, since we convert it to index_patterns before sending the REST request to the server. I wasn't sure how to address this, any guidance here would be great.

Copy link
Contributor

@gwbrown gwbrown Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can and should add a check to the Deprecation Info API, but that still leaves folks using the OSS distribution lacking a notification.

This comment was based on a misunderstanding, please disregard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To help clarify my original comment, I am wondering how to warn users of the Java HLRC that they can no longer specify template when using PutIndexTemplateRequest#source. Before this PR we would silently convert it to index_patterns before sending it off to the server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the 7.x branch to add a deprecation warning if template was used and remove it in 8.0? That seems reasonable to me (if possible with the HLRC)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakrone this is a nice idea, I'll open a follow-up PR against 7.x to emit a deprecation warning if template is used.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left a comment about the HLRC question.

patterns(Collections.singletonList((String) entry.getValue()));
}
} else if (name.equals("index_patterns")) {
if (name.equals("index_patterns")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the 7.x branch to add a deprecation warning if template was used and remove it in 8.0? That seems reasonable to me (if possible with the HLRC)

@jtibshirani
Copy link
Contributor Author

@elasticmachine update branch

@jtibshirani
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@jtibshirani
Copy link
Contributor Author

I opened #50831, which updates the HLRC in 7.x to ensure that a deprecation warning is emitted. @dakrone it would be great if you could take a look.

@jtibshirani jtibshirani merged commit 54f5907 into elastic:master Jan 10, 2020
@jtibshirani jtibshirani deleted the remove-template-field branch January 10, 2020 01:08
jtibshirani added a commit that referenced this pull request Jan 10, 2020
…50831)

Since 6.0, the 'template' field has been deprecated in put template requests in
favour of index_patterns. Previously, the PutIndexTemplateRequest would accept
the 'template' field in its 'source' methods and silently convert it to
'index_patterns'. This meant that users specifying 'template' in the source
would not receive a deprecation warning from the server.

This PR makes a small change to no longer silently convert 'template' to
'index_patterns', which ensures that users receive a deprecation warning.

Follow-up to #49460.
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
The `template` field was deprecated in 6.0 in favor of `index_patterns`, and can
now be removed.

Relates to elastic#21009.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>breaking :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants