-
Notifications
You must be signed in to change notification settings - Fork 40.5k
WIP: client-go transport: allow forcing debug wrapping #131508
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
base: master
Are you sure you want to change the base?
WIP: client-go transport: allow forcing debug wrapping #131508
Conversation
This may be useful in consumers which do not configure klog verbosity. More work may be necessary in callers of the transport package. For example, the transports constructed here still only depend on klog verbosity: https://github.com/kubernetes/kubernetes/blob/0abee6bd55f7274f06174d9404050c684d9f9f35/staging/src/k8s.io/client-go/rest/transport.go#L71-L8 https://github.com/kubernetes/kubernetes/blob/0abee6bd55f7274f06174d9404050c684d9f9f35/staging/src/k8s.io/client-go/transport/websocket/roundtripper.go#L179-L183 Extending transport.Config with an additional boolean is backwards-compatible. If unset, the previous behavior is preserved (i.e. checking klog.V(6)).
Skipping CI for Draft Pull Request. |
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pohly The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -43,7 +43,7 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip | |||
rt = config.WrapTransport(rt) | |||
} | |||
|
|||
rt = DebugWrappers(rt) | |||
rt = MaybeDebugWrappers(rt, config.ForceDebugWrappers) |
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.
@alvaroaleman, @ahmetb: which APIs built on top of his would need to be extended to make this useful for consumers of controller-runtime?
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 think the Maybe
portion is just not gonna be easy to work with. We want this to be ideally enabled for all controllers by default, and most controllers explicitly provide a rest.Config
to the controller-runtime, and they won't do ForceDebugWrappers=true
.
I'd really want us to reconsider always wrapping. I remember the concern was having another point where ctx cancellation could happen, or another method shows up in the call stack? These don't strike me as too critical, and they can be mitigated to a good extent.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This may be useful in consumers which do not configure klog verbosity. More work may be necessary in callers of the transport package. For example, the transports constructed here still only depend on klog verbosity:
https://github.com/kubernetes/kubernetes/blob/0abee6bd55f7274f06174d9404050c684d9f9f35/staging/src/k8s.io/client-go/rest/transport.go#L71-L8
kubernetes/staging/src/k8s.io/client-go/transport/websocket/roundtripper.go
Lines 179 to 183 in 0abee6b
Which issue(s) this PR fixes:
This is an alternative to #129831.
Special notes for your reviewer:
Extending transport.Config with an additional boolean is backwards-compatible. If unset, the previous behavior is preserved (i.e. checking klog.V(6)).
/cc @alvaroaleman @ahmetb