-
Notifications
You must be signed in to change notification settings - Fork 593
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
Implement recursive SanitizedCopy() for KongState, refactor SetCredential #1021
Conversation
8b11ab0
to
5c713c0
Compare
Codecov Report
@@ Coverage Diff @@
## next #1021 +/- ##
==========================================
+ Coverage 49.78% 51.33% +1.55%
==========================================
Files 32 33 +1
Lines 3224 3327 +103
==========================================
+ Hits 1605 1708 +103
Misses 1487 1487
Partials 132 132
Continue to review full report at Codecov.
|
5c713c0
to
4ecddab
Compare
|
74a94de
to
1f85ac1
Compare
1f85ac1
to
dc111c3
Compare
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.
Change that dismissed the old approval was just the retarget to next, correct? Re-approving since I don't think anything else changed.
To summarize some conversation from yesterday, there are two different properties I'd ideally like for the redacted dumps:
- You can diff dumps from before and after a change in K8S configuration to see what changed in the resulting Kong configuration.
- You can apply a dump to Kong via decK or a /config POST.
These unfortunately work against one another. Replacing sensitive values with just REDACTED
prevents you from applying the config because it creates conflicting credentials and invalid certificates (we check key validity), whereas using random valid values breaks the ability to compare before/after dumps effectively.
I'd explored trying to generate garbage valid configuration that only changed if the underlying actual values changed, but that proved tricky to get right. Stripping certificates, credentials, and references to them from config can also produce valid configuration, but goes against @mflendrich's wish to not cherry-pick the redacted content.
In the interest of expediency, I think it makes sense to choose one or the other and live with the shortcomings. This version preserves diffability.
Thanks for the reviews!
Retarget to next + rebase. |
dc111c3
to
6c28445
Compare
Merge didn't conflict these since they were in different locations in the file. Remove old versions in favor of the #1021 version.
Please review commit by commit and merge without squashing.
Inspired by #991.
This PR:
go-kong
types allowing for implementation of KIC business logic in those wrappers) consistently with wrappers for othergo-kong
types (Consumer
,Service
,Route
, etc.)Kongstate.SanitizedCopy()
produces a copy ofKongState
containing only a subset ofKongState
fields,SetCredential
by breaking its type-specific logic out to individual type creator functionsNewXXX()