-
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
Support 7.6 and new stack level enterprise license type #2242
Conversation
if l.Type == string(ElasticsearchLicenseTypeEnterprise) && !v.IsSameOrAfter(version.MustParse("7.6.0")) { | ||
return false | ||
} | ||
return true |
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 know this statement can be collapsed into just returning directly from the comparison, but I found the intent much easier to understand by being a bit redundant 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.
lgtm
@@ -87,3 +87,84 @@ func TestExtractVersion(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestCurrentVersions(t *testing.T) { |
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.
Not really from your PR but should not it be called TestMinVersion
?
@@ -21,14 +22,16 @@ type licenseWithTimeLeft struct { | |||
// desired license type and the remaining validity period of the license. | |||
// Returns the license, parent license UID, a bool indicating a match was found and an optional error. | |||
func BestMatch( | |||
minVersion *version.Version, |
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 update the godoc to mention why there is an additional parameter ? (not 💯 % it's really worth it but it can help when we read the code)
Relates to #2197