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

feat: implement KongLicense controller and inject to translator #5514

Merged
merged 11 commits into from
Feb 6, 2024

Conversation

randmonkey
Copy link
Contributor

@randmonkey randmonkey commented Feb 1, 2024

What this PR does / why we need it:

The PR implements a KongLicense controller which picks the newest KongLicense in the cluster and provides a GetLicense method for translator to inject Kong license into Kong configurations.
The controller is enabled when --enable-controller-kong-license is set to true (by default) and sync license with Konnect disabled. When sync license with Konnect is enabled, the licenses from Konnect takes the precedence.

Which issue this PR fixes:

Major part of #5437.
Special notes for your reviewer:

Not fully finished yet, but can reconcile KongLicense resources and ready to receive some reviews. Major remaining part:

  • When no KongLicense CRD in cluster, the controller will exit abnormally
  • Maybe add validation of KongLicense?
  • Disable applying to Kong gateway when it is OSS (in another issue/PR?)

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@randmonkey randmonkey requested a review from a team as a code owner February 1, 2024 10:28
@randmonkey randmonkey self-assigned this Feb 1, 2024
@randmonkey randmonkey added area/feature New feature or request area/kong Issue with Kong proxy behavior, rather than the controller area/CRD Changes in existing CRDs or introduction of new ones work in progress Work In Progress release/required it is required that this be resolved before releasing and removed size/L labels Feb 1, 2024
@randmonkey randmonkey added this to the KIC v3.1.x milestone Feb 1, 2024
@randmonkey randmonkey removed the area/kong Issue with Kong proxy behavior, rather than the controller label Feb 1, 2024
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: 161 lines in your changes are missing coverage. Please review.

Comparison is base (1a1bbfc) 71.8% compared to head (c844423) 71.2%.
Report is 10 commits behind head on main.

Files Patch % Lines
...ontrollers/configuration/konglicense_controller.go 23.0% 138 Missing and 2 partials ⚠️
internal/manager/setup.go 47.0% 16 Missing and 2 partials ⚠️
internal/manager/run.go 78.5% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5514     +/-   ##
=======================================
- Coverage   71.8%   71.2%   -0.6%     
=======================================
  Files        176     177      +1     
  Lines      18085   18301    +216     
=======================================
+ Hits       12986   13042     +56     
- Misses      4157    4306    +149     
- Partials     942     953     +11     

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

@randmonkey randmonkey force-pushed the feat/kong_license_controller branch 3 times, most recently from def8fad to 602546f Compare February 2, 2024 03:53
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Feb 2, 2024
@randmonkey randmonkey removed the work in progress Work In Progress label Feb 2, 2024
@randmonkey randmonkey changed the title [WIP] feat: implement KongLicense controller and inject to translator feat: implement KongLicense controller and inject to translator Feb 2, 2024
@czeslavo
Copy link
Contributor

czeslavo commented Feb 2, 2024

BTW it might make sense to not include integration tests and translator code in this PR to not make it bigger as it's already 2k+ lines. :)

internal/manager/run.go Outdated Show resolved Hide resolved
@randmonkey randmonkey added the ci/run-e2e Trigger e2e test run from PR label Feb 6, 2024
@team-k8s-bot
Copy link
Collaborator

E2E (targeted) tests with KIND-based clusters were started at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/7795253842

@team-k8s-bot team-k8s-bot removed the ci/run-e2e Trigger e2e test run from PR label Feb 6, 2024
@randmonkey randmonkey merged commit cf99004 into main Feb 6, 2024
160 of 172 checks passed
@randmonkey randmonkey deleted the feat/kong_license_controller branch February 6, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CRD Changes in existing CRDs or introduction of new ones area/feature New feature or request release/required it is required that this be resolved before releasing size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants