-
Notifications
You must be signed in to change notification settings - Fork 99
Add support for additional license fields in template context #5420
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
base: main
Are you sure you want to change the base?
Conversation
- Add camelCase support for isDisasterRecoverySupported - Add isKotsInstallEnabled license field support - Add isEmbeddedClusterDownloadEnabled license field support - Add isSupportBundleEnabled field (maps to IsSupportBundleUploadSupported) - Add isNewKotsUiEnabled license field support - Add comprehensive test coverage for all new license fields These additions allow KOTS configs to access more license field values through the LicenseFieldValue template function.
| return strconv.FormatBool(ctx.License.Spec.IsSnapshotSupported) | ||
| case "IsDisasterRecoverySupported": | ||
| return strconv.FormatBool(ctx.License.Spec.IsDisasterRecoverySupported) | ||
| case "isDisasterRecoverySupported": |
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.
looks like a duplicate of what's above?
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.
Specifically this is a normal camelCase option, leaving the other one there for backwards compatibility in case users are currently using the Is vs is
| return util.ReplicatedAppEndpoint(ctx.License) | ||
| case "licenseID", "licenseId": | ||
| return ctx.License.Spec.LicenseID | ||
| case "isKotsInstallEnabled": |
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.
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.
Oh interesting, do I go ahead and add it in there? The field is currently on our license.yamls.
Summary
This PR adds support for additional license fields in the KOTS template context, enabling KOTS configs to access more license field values through the
LicenseFieldValuetemplate function.Changes Made
New License Fields Added:
isDisasterRecoverySupported- camelCase version of the existing fieldisKotsInstallEnabled- enables access to KOTS install permissionisEmbeddedClusterDownloadEnabled- enables access to embedded cluster download permissionTesting
Use Case
This enables KOTS configuration files to display license capabilities:
Backward Compatibility
Resolves the need for accessing additional license field values in KOTS configuration templates.
Relavent shortcut:
https://app.shortcut.com/replicated/story/126762/add-support-for-additional-license-fields-in-template-context