-
Notifications
You must be signed in to change notification settings - Fork 591
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
refactor: decouple toDeckConfig/OnUpdate from controller, and expose as libraries #1029
Conversation
Codecov Report
@@ Coverage Diff @@
## next #1029 +/- ##
==========================================
+ Coverage 51.42% 53.84% +2.41%
==========================================
Files 33 33
Lines 3327 3172 -155
==========================================
- Hits 1711 1708 -3
+ Misses 1485 1332 -153
- Partials 131 132 +1
Continue to review full report at Codecov.
|
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.
I'll need to rework #991 around this but have had difficulty fitting it around the existing monolithic functions, so agreed that breaking this functionality out will make it easier to add new components around them. Thanks for the refactor 👍
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 good. I have no blocking comments, but I do have a couple smaller things related to godoc and comments. 👍
// FIXME | ||
// decK will release this official API soon, use that and remove this code. |
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.
I know this was just imported from existing code, but can we improve this with an issue link or any other breadcrumbs for the reader?
The clean way to enable SetDebugMode would be to pass a client with SetDebugMode enabled from main().
Re-add config dump following merger of decouple refactor (PR #1029). Auto-merge created a confusing conflict, so it was easier to merge it in with strategy "theirs" and then place the dump path in OnUpdate and helper back after the fact.
This PR:
pkg/deckgen
that exposesToDeckContent()
acting as a converter fromKongState
tofile.Content
ToDeckContent()
(as opposed toToDeckContent()
querying data sources for info directly)pkg/sendconfig
that connects to Kong Admin API in order to configure it according tofile.Content
Why we need this change: in order to expose the existing (
KongState
->file.Content
andfile.Content
-> Kong Admin API) operations as a library, to be used by the prototype port of KIC to kubebuilder.Please review commit-by-commit. None of the commits (except for the modified SHA diffing) should change existing behavior. I recommend merging without squashing either - because individual moves are much easier to comprehend in individual commits.
Testing plan: