-
Notifications
You must be signed in to change notification settings - Fork 24.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
Add max_resource_units to enterprise license #50735
Add max_resource_units to enterprise license #50735
Conversation
The enterprise license type must has "max_resource_units" and may not have "max_nodes". This change adds support for this new field, validation that the field is present if-and-only-if the license is enterprise and bumps the license version number to reflect the new field.
Pinging @elastic/es-security (:Security/License) |
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
private static void validateLimits(String type, int maxNodes, int maxResourceUnits) { | ||
if (LicenseType.isEnterprise(type)) { | ||
if (maxResourceUnits == -1) { | ||
throw new IllegalStateException("maxResourceUnits must be set for enterprise licenses"); |
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.
nit:
throw new IllegalStateException("maxResourceUnits must be set for enterprise licenses"); | |
throw new IllegalStateException("maxResourceUnits must be set for license type [" + type + "]"); |
if (maxResourceUnits == -1) { | ||
throw new IllegalStateException("maxResourceUnits must be set for enterprise licenses"); | ||
} else if (maxNodes != -1) { | ||
throw new IllegalStateException("maxNodes may not be set for enterprise licenses"); |
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.
throw new IllegalStateException("maxNodes may not be set for enterprise licenses"); | |
throw new IllegalStateException("maxNodes may not be set license type [" + type + "]"); |
if (maxNodes == -1) { | ||
throw new IllegalStateException("maxNodes has to be set"); | ||
} else if (maxResourceUnits != -1) { | ||
throw new IllegalStateException("maxResourceUnits may only be set for enterprise licenses"); |
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.
throw new IllegalStateException("maxResourceUnits may only be set for enterprise licenses"); | |
throw new IllegalStateException("maxResourceUnits may only be set license type [" + type + "]"); |
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.
This suggestion is backwards. I could change it to say that they "may not be set for license type [" + type + "]"
, but it seemed more helpful to explain when they are permitted than to just reject them for the current type.
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.
Sure, makes sense, sorry for the half-baked suggestion
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
The enterprise license type must have "max_resource_units" and may not have "max_nodes". This change adds support for this new field, validation that the field is present if-and-only-if the license is enterprise and bumps the license version number to reflect the new field. Includes a BWC layer to return "max_nodes: ${max_resource_units}" in the GET license API. Backport of: elastic#50735
The enterprise license type must have "max_resource_units" and may not have "max_nodes". This change adds support for this new field, validation that the field is present if-and-only-if the license is enterprise and bumps the license version number to reflect the new field. Includes a BWC layer to return "max_nodes: ${max_resource_units}" in the GET license API. Backport of: #50735
The enterprise license type must has "max_resource_units" and may not have "max_nodes". This change adds support for this new field, validation that the field is present if-and-only-if the license is enterprise and bumps the license version number to reflect the new field.
@tvernum I'd like to test that ECE can install this version of the enterprise license on clusters that support it. Is this version of the stack license supported on any 7.6 snapshot, or is there a specific tagged stack version I need to use for testing? |
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse.
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse. Co-authored-by: Russ Cam <[email protected]>
Relates: #4341, elastic/elasticsearch#49223, elastic/elasticsearch#50735 This commit adds support for Enterprise LicenseType, and adds max_resource_units to GetLicenseResponse. (cherry picked from commit c737df6)
…es (#75479) in #50067 for _license the accept_enterprise = false was no longer supported. This commit allows it under rest compatibility and is showing enterprise licenses as platinum The same change had to be applied to _xpack endpoint #58217 in #50735 max_resource_units was introduced to be more accurate. For v7 requests, which do not know about enterprise license we will return max_node which will be set from max_resource_units (it assumes that one resource unit is 32GB - which corresponds to 1 node) relates #51816
…es (elastic#75479) in elastic#50067 for _license the accept_enterprise = false was no longer supported. This commit allows it under rest compatibility and is showing enterprise licenses as platinum The same change had to be applied to _xpack endpoint elastic#58217 in elastic#50735 max_resource_units was introduced to be more accurate. For v7 requests, which do not know about enterprise license we will return max_node which will be set from max_resource_units (it assumes that one resource unit is 32GB - which corresponds to 1 node) relates elastic#51816
The enterprise license type must has "max_resource_units" and may not
have "max_nodes".
This change adds support for this new field, validation that the field
is present if-and-only-if the license is enterprise and bumps the
license version number to reflect the new field.