Skip to content
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

Allow to delete indices related to index templates #1692

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we make sure that index patterns are allowed when deleting indices that are related to index templates (both legacy and composable templates). Prior to this commit, an attempt to delete a related index would fail with:

Wildcard expressions or all indices are not allowed

This is because Elasticsearch requires
action.destructive_requires_name to be set to false in order to process delete requests with wildcards.

Relates #1152

With this commit we make sure that index patterns are allowed when
deleting indices that are related to index templates (both legacy and
composable templates). Prior to this commit, an attempt to delete a
related index would fail with:

```
Wildcard expressions or all indices are not allowed
```

This is because Elasticsearch requires
`action.destructive_requires_name` to be set to `false` in order to
process delete requests with wildcards.

Relates elastic#1152
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. labels Mar 27, 2023
@danielmitterdorfer danielmitterdorfer added this to the 2.8.0 milestone Mar 27, 2023
@danielmitterdorfer danielmitterdorfer self-assigned this Mar 27, 2023
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM

# ensure that we do not provide an empty index pattern by accident
if delete_matching_indices and index_pattern:
# only set if really required
if current_destructive_setting is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

For anyone else wondering what's up here, it's related to the delete-matching-indices property of templates and composable-templates.

@danielmitterdorfer danielmitterdorfer merged commit 9cd9e5f into elastic:master Mar 29, 2023
@danielmitterdorfer danielmitterdorfer deleted the delete-idx-wildcard branch March 29, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants