-
Notifications
You must be signed in to change notification settings - Fork 6.4k
fix: avoid unnecessary GetSettings
calls (#17277) (#23965)
#24021
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
fix: avoid unnecessary GetSettings
calls (#17277) (#23965)
#24021
Conversation
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
GetSettings
callsGetSettings
calls
GetSettings
callsGetSettings
calls
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24021 +/- ##
==========================================
+ Coverage 60.25% 60.26% +0.01%
==========================================
Files 347 347
Lines 59354 59366 +12
==========================================
+ Hits 35761 35775 +14
+ Misses 20724 20719 -5
- Partials 2869 2872 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
GetSettings
callsGetSettings
calls (#17277) (#23965)
This generally LGTM, but can we add a test for this? |
@blakepettersson I’m not well-versed in Go, especially testing patterns. From what I’ve read, if I wanted to know whether Is there a simpler way to count method calls? Or am I off-base on your request? |
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
@blakepettersson 892de07 adds an I’m totally open to alternatives if there’s a more project-standard way of doing this. |
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
…essary-get-settings Signed-off-by: Matthew Bennett <mtbennett@godaddy.com>
@mtbennett-godaddy I wonder if an approach similar to #22282 wouldn't be preferable, since while your approach works, it means that any other future invocation that doesn't follow your pattern would surface this issue again. If we fix this at its core rather than trying to prevent excessive |
@blakepettersson Honestly, my top priority here was to reduce the #22282 seems abandoned? Want me to close this PR and open a new one using #22282’s approach with tests? |
Superseded by #24080 |
Fixes #17277, #23965.
Every reconciliation performed by our application set controller prints 2
Loading TLS configuration from secret
messages per app (and we have hundreds of apps). Tracked it down to the fact that multiple cluster DB methods (GetCluster
, specifically in our case) callGetSettings()
unconditionally but only end up referencing the settings if the cluster in question is the current k8s cluster (appv1.KubernetesInternalAPIServerAddr
).This updates
GetCluster
,GetClusterServersByName
, andCreateCluster
to only callGetSettings
if considering the current cluster.Checklist:
[ ] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.[ ] Does this PR require documentation updates?[ ] I've updated documentation as required by this PR.[ ] My new feature complies with the feature status guidelines.