-
Notifications
You must be signed in to change notification settings - Fork 40.9k
Add emulation version info to client-go's user-agent #131401
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?
Conversation
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. |
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Apr 21 13:37:44 UTC 2025. |
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. |
238bc3d
to
d99cd2d
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.
Can you provide more details (in the description) why the change is needed and why to the scheduler only.
client, err := clientset.NewForConfig(restclient.AddUserAgent(kubeConfig, "scheduler")) | ||
func createClients(kubeConfig *restclient.Config, componentRegistry basecompatibility.ComponentGlobalsRegistry) (clientset.Interface, clientset.Interface, error) { | ||
effectiveVer := componentRegistry.EffectiveVersionFor(basecompatibility.DefaultKubeComponent) | ||
compatVersionInfo := fmt.Sprintf("%s=%s", "emulationVersion", effectiveVer.EmulationVersion()) |
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.
Shouldn't it be empty (not reported) if there is no emulation version?
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.
Revised it, PTAL now.
48c8a7d
to
40b668d
Compare
@Jefftree would you review for emulation version bits? @richabanker Can we find some way to harness this with a test? |
a615213
to
cea44bc
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: richabanker 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 |
cea44bc
to
6771a0e
Compare
6771a0e
to
38ecdc5
Compare
The version info added here in the request header will eventually be used to record an apiserver metric that tells the number of out-of-skew requests seen so far, a concern raised by @liggitt here was that "user-agent headers are totally under the client's control... and don't drive any behavior... feels a little weird to base apiserver metrics on them
Do we want to re-evaluate whether clients sending version info in request headers is the right way to go about this? @deads2k for your thoughts since this requirement came from this discussion on the KEP |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds Emulation Version and Min-Compat Version info to client-go's UserAgent (currently only has Binary Version) which is propagated as a request header
Which issue(s) this PR fixes:
This is needed to have a request level metric which tracks number of out-of-skew requests received by the apiserver. This is one of the beta requirements for https://github.com/kubernetes/enhancements/tree/master/keps/sig-architecture/4330-compatibility-versions , ref
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: