-
Notifications
You must be signed in to change notification settings - Fork 63
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
[WIP] Add some debugging for kubeclient #508
Conversation
Kubeclient uses RestClient for 4.x versions for the main connection but the http gem for watches. On master, kubeclient uses faraday for main connections. This commit provides a way to patch restclient/faraday and http to add logging of request/response. TODO: We will need to provide a way to sanitize passwords and possibly other information.
I'm seeing "body has already been consumed" locally with this patch, specifically, the WatchThread prepend:
This still needs to be resolved. |
if conn.respond_to?(:configure_faraday) | ||
conn.configure_faraday { |faraday| faraday.response :logger } | ||
else | ||
RestClient.log = STDOUT |
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.
Should this be STDERR, to match the $stderr
used in the prepended patch?
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.
👍 it's blowing up so I've shelved it for now.
Checked commit jrafanie@1237e0d with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint app/models/manageiq/providers/kubernetes/container_manager.rb
lib/manageiq/providers/kubernetes/debug_kubeclient_watch.rb
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
module Kubernetes | ||
module DebugKubeclientWatch | ||
def build_client | ||
super.use(logging: { logger: Logger.new($stderr) }) |
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.
would a tap
fix this?
i.e.:
super.use(logging: { logger: Logger.new($stderr) }) | |
super.tap { |client| client.use(:logging => {:logger => Logger.new($stderr) }) } |
... sorry. flyby ...
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
1 similar comment
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
Stale, closing for now |
Kubeclient uses RestClient for 4.x versions for the main connection but the http gem for watches. On master, kubeclient uses faraday for main connections. This commit provides a way to patch restclient/faraday and http to add logging of request/response.
TODO: We will need to provide a way to sanitize passwords and possibly other information.