-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Check if another resource exists when creating an alias #13070
Conversation
When creating an alias, if an index exists with the same name, alias is not created assuming that it already exists. This can create some confusion in some cases, as users can see that setup works, but indexes and aliases are not correctly configured afterwards, leading to field mapping issues and other kinds of problems. This change makes beats explictly check if the resource that already exists is actually an alias, if not, it returns a different failure that can be seen by the user when running setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with double-checking here, but it would be nice if HasAlias
would already report an error if the resource found is no alias.
Maybe we should better use the cat API: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html
@urso I have added a check also to Regarding using the |
jenkins, test this again please |
jenkins, test this again please |
Failing tests are not related, merging this. |
When creating an alias, if an index exists with the same name, alias is
not created assuming that it already exists. This can create some
confusion in some cases, as users can see that setup works, but indexes
and aliases are not correctly configured afterwards, leading to field
mapping issues and other kinds of problems.
This change makes beats explictly check if the resource that already
exists is actually an alias, if not, it returns a different failure that
can be seen by the user when running setup.