Skip to content

Commit

Permalink
Only "include_type_name" if running on >= 7 (elastic#38594)
Browse files Browse the repository at this point in the history
In cluster restart tests, we need to "include_type_name" if the
cluster includes a pre-7 version, but the test is running against
a 7+ version
  • Loading branch information
tvernum authored Feb 8, 2019
1 parent 84483b2 commit 1008f1c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,8 @@ public void testSnapshotRestore() throws IOException {
createTemplateRequest.setJsonEntity(Strings.toString(templateBuilder));

// In 7.0, type names are no longer expected by default in put index template requests.
// We therefore use the deprecated typed APIs when running against the current version.
if (isRunningAgainstAncientCluster()) {
// We therefore use the deprecated typed APIs when running against the current version, but testing with a pre-7 version
if (isRunningAgainstOldCluster() == false && getOldClusterVersion().major < 7) {
createTemplateRequest.addParameter(INCLUDE_TYPE_NAME_PARAMETER, "true");
}
createTemplateRequest.setOptions(allowTypeRemovalWarnings());
Expand Down

0 comments on commit 1008f1c

Please sign in to comment.