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

Migrate server.enterpriseLicense to global.enterpriseLicense #856

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

thisisnotashwin
Copy link
Contributor

Changes proposed in this PR:

  • Migrate the enterpriseLicense config from being under the server stanza to the global stanza.
  • This change breaks backwards compatibility but prints an error stating the same. This will not cause existing installations to fail.

How I've tested this PR:

  • bats
  • Acceptance tests

How I expect reviewers to test this PR:

  • code review
  • would love to hear thoughts on the breaking nature of the change.

Checklist:

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)

@thisisnotashwin thisisnotashwin requested review from ishustava, a team and kschoche and removed request for a team November 10, 2021 17:25
@thisisnotashwin thisisnotashwin force-pushed the move-enterprise-license-block-to-global branch from 2ff2b1e to c94448b Compare November 10, 2021 17:27
@@ -1,5 +1,6 @@
{{- if (or (and (ne (.Values.client.enabled | toString) "-") .Values.client.enabled) (and (eq (.Values.client.enabled | toString) "-") .Values.global.enabled)) }}
{{- if .Values.client.snapshotAgent.enabled }}
{{- if .Values.server.enterpriseLicense }}{{ fail ".Values.server.enterpriseLicense has been moved to .Values.global.enterpriseLicense" }}{{ end -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- if .Values.server.enterpriseLicense }}{{ fail ".Values.server.enterpriseLicense has been moved to .Values.global.enterpriseLicense" }}{{ end -}}
{{- if .Values.server.enterpriseLicense }}{{ fail "server.enterpriseLicense has been moved to global.enterpriseLicense" }}{{ end -}}

Should be an error the user can understand. The don't know what .Values is.

@thisisnotashwin thisisnotashwin force-pushed the move-enterprise-license-block-to-global branch from c94448b to df90cf9 Compare November 10, 2021 17:46
@@ -1,5 +1,6 @@
{{- if (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) }}
{{- if (and .Values.server.enterpriseLicense.secretName .Values.server.enterpriseLicense.secretKey (not .Values.server.enterpriseLicense.enableLicenseAutoload)) }}
{{- if (and .Values.global.enterpriseLicense.secretName .Values.global.enterpriseLicense.secretKey (not .Values.global.enterpriseLicense.enableLicenseAutoload)) }}
{{- if .Values.server.enterpriseLicense }}{{ fail "server.enterpriseLicense has been moved to global.enterpriseLicense" }}{{ end -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put the fail at the top? And then maybe we only need one for the entire chart.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AAH! ok that makes sense. It should simplify the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the bats test for this check also reside only for that file or does it make sense to test that change in all the files that utilize the license? 🤔
I see the argument in doing both.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pattern we've followed is only for that file. Let me check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's the pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 thanks!!

@thisisnotashwin thisisnotashwin force-pushed the move-enterprise-license-block-to-global branch from df90cf9 to 30d44f5 Compare November 10, 2021 18:02
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog

@@ -1,5 +1,6 @@
{{- if (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) }}
{{- if (and .Values.server.enterpriseLicense.secretName .Values.server.enterpriseLicense.secretKey (not .Values.server.enterpriseLicense.enableLicenseAutoload)) }}
{{- if (and .Values.global.enterpriseLicense.secretName .Values.global.enterpriseLicense.secretKey (not .Values.global.enterpriseLicense.enableLicenseAutoload)) }}
{{- if .Values.server.enterpriseLicense }}{{ fail ".Values.server.enterpriseLicense has been moved to .Values.global.enterpriseLicense" }}{{ end -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this in all templates. As long as one of them fails at any given time, that should be fine. So for example, it makes sense to keep the failure in servers and clients since you can run with either just servers or just clients, but for ent license job, we probably don't need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh!! Luke raced you to it!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops! haha Luke FTW!

@thisisnotashwin thisisnotashwin force-pushed the move-enterprise-license-block-to-global branch from 30d44f5 to e1fe321 Compare November 10, 2021 20:57
@thisisnotashwin thisisnotashwin merged commit ae3b792 into main Nov 10, 2021
@thisisnotashwin thisisnotashwin deleted the move-enterprise-license-block-to-global branch November 10, 2021 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants