-
Notifications
You must be signed in to change notification settings - Fork 717
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
Refactor node configuration and add role validation #3694
Refactor node configuration and add role validation #3694
Conversation
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.
LGTM, tested and it seems to work. One nit.
masterRequiredMsg = "Elasticsearch needs to have at least one master node" | ||
parseVersionErrMsg = "Cannot parse Elasticsearch version. String format must be {major}.{minor}.{patch}[-{label}]" | ||
mixedRoleConfigMsg = "Detected a combination of node.roles and %s. Use only node.roles" |
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.
Should we just suggest to pick one?
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.
Because there's no good term to describe node.{role}
config settings, I chose to just list them so that the user understands what needs to be removed. Do you think it's not necessary?
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.
Ah, that's fine. I was referring to "Use only node.roles", I thought it might be better to just say that either one approach or the other should be used instead of pointing users to use node.roles
specifically.
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.
Ah I see. Presumably node.roles
is the preferred method of defining roles going forward. I don't even see a mention of node.{role}
settings in the 7.9 docs so I assume they'll be deprecated in the future.
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.
If it is preferred then I'm fine leaving it as it is.
Adds validation of node roles. The checks are:
node.roles
are not supported before 7.7.0node.roles
andnode.{role}
settings should not be mixedA couple of issues were discovered during this work:
voting_only
rolenode.transform
was set tofalse
by the user or by Go's zero value rules)This includes a refactoring to address the above issues as well.
Fixes #3409