Skip to content

Conversation

@martijnvg
Copy link
Member

backporting #74403 to 7.x branch.

When removing aliases allow that an alias action's index expression can match
both data streams and regular indices.

This allows api calls like DELETE /_all/_alias/my-alias, which can common
in tear down / cleanup logic. In this case my-alias just points to regular
indices, but _all can be expanded to data streams too if exist. This can
then trigger validation logic that prevents adding aliases that refer to both
indices and data streams. However this api call never adds any alias, only
removes it. So failing with this validation error doesn't make much sense.

This change adjusts the validation logic so that: 'match with both data streams and
regular indices are disallowed' validation is only executed for alias actions
that add aliases.

Relates to #66163

…dices. (elastic#74403)

When removing aliases allow that an alias action's index expression can match
both data streams and regular indices.

This allows api calls like `DELETE /_all/_alias/my-alias`, which can common
in tear down / cleanup logic. In this case `my-alias` just points to regular
indices, but `_all` can be expanded to data streams too if exist. This can
then trigger validation logic that prevents adding aliases that refer to both
indices and data streams. However this api call never adds any alias, only
removes it. So failing with this validation error doesn't make much sense.

This change adjusts the validation logic so that: 'match with both data streams and
regular indices are disallowed' validation is only executed for alias actions
that add aliases.

Relates to elastic#66163
@martijnvg martijnvg merged commit 966b1e0 into elastic:7.x Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant