Skip to content

[8.0] Fix ComposableIndexTemplate equals when composed_of is null (#80864)#81132

Merged
elasticsearchmachine merged 2 commits intoelastic:8.0from
dakrone:backport/8.0/pr-80864
Nov 30, 2021
Merged

[8.0] Fix ComposableIndexTemplate equals when composed_of is null (#80864)#81132
elasticsearchmachine merged 2 commits intoelastic:8.0from
dakrone:backport/8.0/pr-80864

Conversation

@dakrone
Copy link
Copy Markdown
Member

@dakrone dakrone commented Nov 29, 2021

Backports the following commits to 8.0:

…80864)

when composed_of is null, the ComposableIndexTemplate will return an empty list. it will cause the input and output ComposableIndexTemplate not equals.

reproduce:
in ComposableIndexTemplateTests.randomInstance method, make `List<String> componentTemplates = null;`, there are the failed tests:
```
Tests with failures:
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testAddIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2Wildcards
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testUpdateIndexTemplateV2
 - org.elasticsearch.cluster.metadata.MetadataIndexTemplateServiceTests.testRemoveMultipleIndexTemplateV2
```

the PR add a `componentTemplatesEquals` method to make null and empty list equals .
@dakrone dakrone added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed v8.0.0 labels Nov 29, 2021
@dakrone
Copy link
Copy Markdown
Member Author

dakrone commented Nov 30, 2021

@elasticmachine update branch

@elasticsearchmachine elasticsearchmachine merged commit 1ee6f1e into elastic:8.0 Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants