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
Use GetVersion() API instead of ver command #55143
Conversation
Note that with this PR the kernel verson is in different format as before, e.g. on my local windows 10 laptop
/cc @taylorb-microsoft is this what we expected? |
@feiskyer - thanks for coding this up so quickly!
|
pkg/kubelet/winstats/version.go
Outdated
|
||
KVI.kvi = windows.UTF16ToString(buf[:]) | ||
|
||
// Important - docker.exe MUST be manifested for this API to return |
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.
Ideally should update comment to proper binary name.
To your question on why ver is returning a different URB than what is in the BuildLabEx registry key I'm not sure - can you see what its in that key vs the UBR key? The ver code queries the UBR key for that information. Specifically what they are doing is:
|
@taylorb-microsoft Addressed comments. PTAL |
/retest |
/retest |
/assign @yujuhong @tallclair |
@feiskyer @taylorb-microsoft Thanks for fixing this. I have a similar fix in #55496 but will revert to use yours. One question, for Linux,
Should the osImageVersion be something more verbal such as "Microsoft Windows 10 Enterprise" or "Microsoft Windows Server Datacenter", e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName? Just my 2 cents. |
@tallclair Addressed comments. PTAL |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, tallclair Associated issue: 55083 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest Review the full test history for this PR. |
@tallclair Thanks. Could you also help to approve the milestone? |
[MILESTONENOTIFIER] Milestone Pull Request Needs Attention @feiskyer @tallclair @yujuhong @kubernetes/sig-node-misc Action required: During code slush, pull requests in the milestone should be in progress. Note: If this pull request is not resolved or labeled as Pull Request Labels
|
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 56115, 55143, 56179). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 56995, 58498, 57426, 58902, 58863). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Get windows kernel version directly from registry **What this PR does / why we need it**: #55143 gets windows kernel version by calling windows.GetVersion(), but it doesn't work on windows 10. From https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx, GetVersion requires app to be manifested. Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). I tried a toy go program using GetVersion on Windows 10 and it returns 0x23f00206. Given the limited win32 functions in golang, we should read from registry directly. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #58497 **Special notes for your reviewer**: Should also cherry-pick to v1.9. **Release note**: ```release-note Get windows kernel version directly from registry ``` /cc @JiangtianLi @taylorb-microsoft
What this PR does / why we need it:
Should use GetVersion vs Shelling out to ver.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #55083
Special notes for your reviewer:
Release note: