Skip to content
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

Merged
merged 5 commits into from
Dec 12, 2019

Conversation

pebrc
Copy link
Collaborator

@pebrc pebrc commented Dec 11, 2019

  • support 7.6 and stack level enterprise licenses by preferring enterprise stack license over platinum for 7.6 and upwards
  • moved some code around because of import cycles (I think we may need a larger rethink of the dependencies with in the project)
  • does not yet include for the new settings (will raise separate PR)
  • does not yet include 8.x support
  • testing is possible only with current master snapshots of Elasticsearch

Relates to #2197

if l.Type == string(ElasticsearchLicenseTypeEnterprise) && !v.IsSameOrAfter(version.MustParse("7.6.0")) {
return false
}
return true
Copy link
Collaborator Author

@pebrc pebrc Dec 11, 2019

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.

@pebrc pebrc marked this pull request as ready for review December 11, 2019 16:29
Copy link
Contributor

@barkbay barkbay left a 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) {
Copy link
Contributor

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,
Copy link
Contributor

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)

@pebrc pebrc added >enhancement Enhancement of existing functionality v1.0.0 labels Dec 12, 2019
@pebrc pebrc merged commit d212d41 into elastic:master Dec 12, 2019
@thbkrkr thbkrkr changed the title Support 7.6 and new stack level enterprise license type. Support 7.6 and new stack level enterprise license type Jan 9, 2020
mjmbischoff pushed a commit to mjmbischoff/cloud-on-k8s that referenced this pull request Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants