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: make scheme conditional on provided feature gates #3539

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Feb 13, 2023

What this PR does / why we need it:

This PR makes the manager scheme to be conditional on the provided feature gates.

Apart from e.g. not registering schemes that we don't use this might come in handy later ;). For instance: doing some exploratory work for using client.Client in Store I noticed that this will be useful to have.

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

@pmalek pmalek added area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. refactor labels Feb 13, 2023
@pmalek pmalek self-assigned this Feb 13, 2023
@pmalek pmalek added this to the KIC v2.9.0 milestone Feb 13, 2023
@pmalek pmalek force-pushed the scheme-based-on-feature-gates branch from 1218fd1 to ea50b60 Compare February 13, 2023 10:50
@pmalek pmalek force-pushed the scheme-based-on-feature-gates branch from ea50b60 to 9ccdd54 Compare February 13, 2023 11:22
@codecov
Copy link

codecov bot commented Feb 13, 2023

Codecov Report

Base: 72.2% // Head: 72.4% // Increases project coverage by +0.2% 🎉

Coverage data is based on head (9ccdd54) compared to base (2ff6462).
Patch coverage: 58.0% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3539     +/-   ##
=======================================
+ Coverage   72.2%   72.4%   +0.2%     
=======================================
  Files        122     123      +1     
  Lines      14381   14384      +3     
=======================================
+ Hits       10395   10428     +33     
+ Misses      3314    3292     -22     
+ Partials     672     664      -8     
Impacted Files Coverage Δ
internal/manager/scheme/scheme.go 25.0% <25.0%> (ø)
internal/manager/config.go 94.3% <100.0%> (ø)
internal/manager/controllerdef.go 98.7% <100.0%> (ø)
internal/manager/featuregates/feature_gates.go 100.0% <100.0%> (ø)
internal/manager/run.go 48.4% <100.0%> (+4.2%) ⬆️
internal/manager/setup.go 46.4% <100.0%> (ø)
internal/dataplane/kongstate/service.go 67.3% <0.0%> (+1.2%) ⬆️
...ternal/controllers/gateway/httproute_controller.go 69.7% <0.0%> (+1.6%) ⬆️
...nternal/controllers/gateway/udproute_controller.go 73.7% <0.0%> (+2.1%) ⬆️
...nternal/controllers/gateway/tlsroute_controller.go 73.4% <0.0%> (+4.0%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pmalek pmalek marked this pull request as ready for review February 13, 2023 11:22
@pmalek pmalek requested a review from a team as a code owner February 13, 2023 11:22
@czeslavo
Copy link
Contributor

Apart from e.g. not registering schemes that we don't use this might come in handy later ;). For instance: doing some exploratory work for using client.Client in Store I noticed that this will be useful to have.

Could you elaborate on this a little bit? Is this exploratory work related to using client.Client for dynamic objects unmarshaling or something like that? I'm just curious. :)

@pmalek
Copy link
Member Author

pmalek commented Feb 13, 2023

Could you elaborate on this a little bit? Is this exploratory work related to using client.Client for dynamic objects unmarshaling or something like that? I'm just curious. :)

Something like this: #2250 but I managed to figure out a patch that incurs way less changes. This way, if we pursue this route for all object's CacheStore we'll be able to remove all the code responsible caching objects and rely on manager's client only (and it's caching, which is configurable https://github.com/kubernetes-sigs/controller-runtime/blob/9f4e5eded684bf47949689ec04c17b2df5de056f/pkg/cache/cache.go#L106-L149 ).

@pmalek pmalek merged commit 39cedda into main Feb 13, 2023
@pmalek pmalek deleted the scheme-based-on-feature-gates branch February 13, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. refactor size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants