-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the 'template' field in index templates. #49460
Remove the 'template' field in index templates. #49460
Conversation
The `template` field was deprecated in 6.0 in favor of `index_patterns`, and can now be removed.
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")) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this 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")) { |
There was a problem hiding this comment.
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)
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/default-distro |
…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.
The `template` field was deprecated in 6.0 in favor of `index_patterns`, and can now be removed. Relates to elastic#21009.
The
template
field was deprecated in 6.0 in favor ofindex_patterns
, and cannow be removed.
Relates to #21009.