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

[Installer]: add license key to Installer config #7120

Merged
merged 2 commits into from
Dec 9, 2021

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Dec 8, 2021

Description

Allows an enterprise license key to be added to the Installer config surface. This creates an optional Kubernetes secret from the volume and loads it into the server config. Also adds cluster validation to ensure that a license secret is set if included in the config YAML.

In the server, this adds licenseFile to the config interface and, if set, it loads it from that location and sets the value to license.

Related Issue(s)

Fixes #6868

How to test

Create a license, load it into a secret and deploy it to your cluster, adding the following block to your config YAML:

license:
  kind: secret
  name: my-test-license

Happy to demo it to the approver(s) if required

Release Notes

[Installer]: add license key to config

Documentation

@roboquat roboquat added team: workspace Issue belongs to the Workspace team size/L and removed size/XS labels Dec 8, 2021
@mrsimonemms mrsimonemms changed the title server debugging [Installer]: add license key to Installer config Dec 8, 2021
@mrsimonemms
Copy link
Contributor Author

mrsimonemms commented Dec 8, 2021

/werft run

👍 started the job as gitpod-build-sje-installer-license-key.3

This includes secret validation if it's present in the config
@mrsimonemms mrsimonemms marked this pull request as ready for review December 8, 2021 14:33
@mrsimonemms mrsimonemms requested review from a team December 8, 2021 14:33
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #7120 (a9fcc08) into main (da3991c) will decrease coverage by 13.28%.
The diff coverage is n/a.

❗ Current head a9fcc08 differs from pull request most recent head e67b493. Consider uploading reports for the commit e67b493 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main   #7120       +/-   ##
==========================================
- Coverage   19.04%   5.76%   -13.29%     
==========================================
  Files           2      13       +11     
  Lines         168    1162      +994     
==========================================
+ Hits           32      67       +35     
- Misses        134    1094      +960     
+ Partials        2       1        -1     
Flag Coverage Δ
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
installer-raw-app 5.76% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go
installer/pkg/common/storage.go 0.00% <0.00%> (ø)
installer/pkg/common/render.go 0.00% <0.00%> (ø)
installer/pkg/components/ws-manager/deployment.go 0.00% <0.00%> (ø)
installer/pkg/components/ws-manager/configmap.go 29.71% <0.00%> (ø)
installer/pkg/common/common.go 4.64% <0.00%> (ø)
installer/pkg/common/objects.go 0.00% <0.00%> (ø)
installer/pkg/common/display.go 0.00% <0.00%> (ø)
...components/ws-manager/unpriviledged-rolebinding.go 0.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da3991c...e67b493. Read the comment docs.

license?: string;
licenseFile?: string;
Copy link
Member

Choose a reason for hiding this comment

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

👍

@mrsimonemms
Copy link
Contributor Author

/hold

@mrsimonemms
Copy link
Contributor Author

/unhold

let license = config.license
const licenseFile = config.licenseFile
if (licenseFile) {
license = fs.readFileSync(licenseFile, "utf-8")
Copy link
Member

Choose a reason for hiding this comment

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

👍

@geropl
Copy link
Member

geropl commented Dec 8, 2021

/lgtm

nice! 👍

@roboquat
Copy link
Contributor

roboquat commented Dec 8, 2021

LGTM label has been added.

Git tree hash: 7ece5094d633533ba47e010b07470c0415a53bb9

Copy link
Contributor

@princerachit princerachit left a comment

Choose a reason for hiding this comment

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

lgtm but should we have this documented somewhere that defining licenseFile will take precedence while loading license

@roboquat
Copy link
Contributor

roboquat commented Dec 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: geropl, princerachit

Associated issue: #6868

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit c27d245 into main Dec 9, 2021
@roboquat roboquat deleted the sje/installer-license-key branch December 9, 2021 09:03
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Installer]: add licence key to config
4 participants