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

add cluster id for license controller. #4237

Merged
merged 10 commits into from Dec 13, 2023
Merged

add cluster id for license controller. #4237

merged 10 commits into from Dec 13, 2023

Conversation

lingdie
Copy link
Collaborator

@lingdie lingdie commented Nov 3, 2023

🤖 Generated by Copilot at 91cb4d8

Summary

🆕🔑🔄

This pull request adds support for cluster-specific licenses in the license controller. It introduces a new component LicenseActivator to activate licenses of different types, and a new field ClusterId to the LicenseReconciler, LicenseValidator, and Claims structs. It also modifies the deployment and secret manifests to inject the cluster id as an environment variable.

Sing, O Muse, of the mighty license controller
That oversees the cluster's lawful operation
And how it learned to handle licenses bound by ClusterId
A secret token forged by Zeus himself in his wisdom

Walkthrough

  • Add a new field ClusterId to the LicenseReconciler struct and pass it to the LicenseValidator and LicenseActivator components (link, link, link)
  • Inject the cluster id into the license controller pod from a secret key using an environment variable CLUSTER_ID (link, link)
  • Implement a new component LicenseActivator that handles the logic of activating the license according to its type (link, link)
  • Remove the unused import of accountutil from the license controller file (link)
  • Add a new field ClusterId to the LicenseValidator struct and the IsLicenseValid method and function (link, link)
  • Add a new field ClusterId to the Claims struct to represent the cluster id in the license token (link)
  • Add a new error variable ErrClusterIdNotMatch to the errors package to indicate the cluster id mismatch (link)

Signed-off-by: yy <lingdie.yy@outlook.com>
@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Nov 3, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 1148
✅ Successful 388
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 759
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Nov 3, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c9527a7) 65.45% compared to head (006d6aa) 65.45%.
Report is 2 commits behind head on main.

❗ Current head 006d6aa differs from pull request most recent head 7e08ca0. Consider uploading reports for the commit 7e08ca0 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4237   +/-   ##
=======================================
  Coverage   65.45%   65.45%           
=======================================
  Files           8        8           
  Lines         660      660           
=======================================
  Hits          432      432           
  Misses        180      180           
  Partials       48       48           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: yy <lingdie.yy@outlook.com>
Signed-off-by: yy <lingdie.yy@outlook.com>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Nov 3, 2023
@lingdie lingdie added this to the v5.0 milestone Nov 6, 2023
Signed-off-by: yy <lingdie.yy@outlook.com>
Signed-off-by: yy <lingdie.yy@outlook.com>
Signed-off-by: yy <lingdie.yy@outlook.com>
lingdie and others added 4 commits December 7, 2023 11:44
Signed-off-by: yy <lingdie.yy@outlook.com>
Signed-off-by: yy <lingdie.yy@outlook.com>
Signed-off-by: yy <lingdie.yy@outlook.com>
@lingdie lingdie merged commit 40e33e0 into labring:main Dec 13, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants