Add validation for component templates#54023
Merged
probakowski merged 7 commits intoelastic:masterfrom Mar 24, 2020
Merged
Conversation
This change adds validation to make sure that settings and mappings are correct in component template. It's done the same way as in index templates - code is reused. Reletes to elastic#53101
Collaborator
|
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
dakrone
approved these changes
Mar 23, 2020
Member
dakrone
left a comment
There was a problem hiding this comment.
LGTM, thanks @probakowski! I left some comments but they're all super minor nits.
server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java
Outdated
Show resolved
Hide resolved
martijnvg
approved these changes
Mar 24, 2020
Member
martijnvg
left a comment
There was a problem hiding this comment.
LGTM
Maybe also add the non-issue label?
This is usually done for changes that are not available by default yet,
because they are developed in a branch or behind a feature flag.
…taIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
…taIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
…taIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
…taIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
…taIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
probakowski
added a commit
to probakowski/elasticsearch
that referenced
this pull request
Mar 24, 2020
* Add validation for component templates This change adds validation to make sure that settings and mappings are correct in component template. It's done the same way as in index templates - code is reused. Reletes to elastic#53101 * Fix checkstyle violation * Update server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
probakowski
added a commit
that referenced
this pull request
Mar 24, 2020
* Add validation for component templates (#54023) * Add validation for component templates This change adds validation to make sure that settings and mappings are correct in component template. It's done the same way as in index templates - code is reused. Reletes to #53101 * Fix checkstyle violation * Update server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateServiceTests.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> * Update server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataIndexTemplateService.java Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com> Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com> * Adjusted to 7.7 * unused import fixed * npe fixeD * change exception type Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds validation to make sure that settings and mappings are correct in
component template. It's done the same way as in index templates - code is reused.
Reletes to #53101