-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Enforce limitations on ILM policy names #35104
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
Merged
gwbrown
merged 19 commits into
elastic:master
from
gwbrown:ilm/enforce-policy-name-restrictions
Nov 9, 2018
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8370a0c
Enforce index-name rules for ILM policy names
gwbrown 782379d
Missed one "index"->"policy"
gwbrown 27ce24b
Add tests for valid policy names
gwbrown 4e3d989
Refactor name checks into a separate class
gwbrown d8cd5f7
Merge branch 'index-lifecycle' into ilm/enforce-policy-name-restrictions
gwbrown 18276bf
A bit of extra cleanup that I missed
gwbrown ebd551d
More cleanup
gwbrown 92db083
Back out changes to shared classes
gwbrown a95d940
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown ea7db68
Switch to looser set of name restrictions
gwbrown 1d5f20d
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown 246328f
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown 97e5701
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown bc8b1ed
Use UTF-8 Charset instead of "UTF-8"
gwbrown b2be88a
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown a0f7a92
Restrict spaces in policy names
gwbrown 6c58f5e
Fix error message with leftover constraints
gwbrown 0ff4c4f
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown a941312
Merge branch 'master' into ilm/enforce-policy-name-restrictions
gwbrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder if it would be nicer for the user if we just have a single message here that describes all the characters that we don't allow in a policy name? This might avoid frustration if the user tries something like
_foo baras the policy name since they will be able to fix everything in one step rather than two?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.
Only if we don't end up with something too complicated. As-is, it's simple to read and validate that it follows the rules when encoded this way. The rules aren't so onerous that I expect any and certainly not multiple to be broken on a routine basis, they will be the exception. We can document the rules in the ILM API guide too, that would help.
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 was thinking it would be ok as
But I don't feel too strongly about this, I agree the likelihood of multiple violations is low since there are too many rules here
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 would argue that's harder to consume for the case of a single violation (the common case contingent on any violation) as now as a user I am left wondering, wait, which rule did I break?
It's like those awful password dialog boxes. Password doesn't meet the required criteria:
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.
ok lets leave it as is then
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.
_(the other characters are okay).