You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow overriding the user agent for the client #2264
It would be great if it was possible for users of a shared client to set the user agent. This would help in being able to correlate api requests to a specific controller out of many that runs within the same binary.
Are you thinking to have a new option in both the client creation and something either in the context or on each call to customize the agent string?
Would also be nice if we can "append" to the user agent, that way we could also configure the agent by controller automatically through a context or some other means?
Plugging this through the context is a nice idea, I didn't think of that! What I originally envisioned was a wrapper, but using the context would have the advantage that we can make it work by default.
I had a brief look into the code for this. What I found is that the only real option that exists to set this is the restCFG and we can not have multiple of them because we absolutely want to share http clients so that we re-use tcp connections as much as possible. What seems to be possible though is to explicitly set the User-Agent header and that will overwrite a pre-existing one, so that could be a possible approach.
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/test-infra repository.
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/test-infra repository.
Activity
vincepri commentedon Apr 27, 2023
Are you thinking to have a new option in both the client creation and something either in the context or on each call to customize the agent string?
Would also be nice if we can "append" to the user agent, that way we could also configure the agent by controller automatically through a context or some other means?
sbueringer commentedon Apr 28, 2023
Very slightly related: #2243 (just when we already do some changes in that area)
There's also something about an unexpected append in there. So we might want to be careful about that.
alvaroaleman commentedon Apr 28, 2023
Plugging this through the context is a nice idea, I didn't think of that! What I originally envisioned was a wrapper, but using the context would have the advantage that we can make it work by default.
I had a brief look into the code for this. What I found is that the only real option that exists to set this is the restCFG and we can not have multiple of them because we absolutely want to share http clients so that we re-use tcp connections as much as possible. What seems to be possible though is to explicitly set the
User-Agentheader and that will overwrite a pre-existing one, so that could be a possible approach.k8s-triage-robot commentedon Jan 19, 2024
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle stale/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
k8s-triage-robot commentedon Feb 18, 2024
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle rotten/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
k8s-triage-robot commentedon Mar 19, 2024
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/reopen/remove-lifecycle rottenPlease send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
k8s-ci-robot commentedon Mar 19, 2024
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
Details
In response to this:
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/test-infra repository.
alvaroaleman commentedon Apr 10, 2024
/reopen
/lifecycle frozen
k8s-ci-robot commentedon Apr 10, 2024
@alvaroaleman: Reopened this issue.
Details
In response to this:
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/test-infra repository.