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

Get windows kernel version directly from registry #58498

Merged
merged 1 commit into from Jan 29, 2018

Conversation

Projects
None yet
8 participants
@feiskyer
Member

feiskyer commented Jan 19, 2018

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:

Get windows kernel version directly from registry

/cc @JiangtianLi @taylorb-microsoft

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Jan 19, 2018

@feiskyer: GitHub didn't allow me to request PR reviews from the following users: taylorb-microsoft, JiangtianLi.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

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:

Get windows kernel version directly from registry

/cc @JiangtianLi @taylorb-microsoft

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.

@feiskyer

This comment has been minimized.

Member

feiskyer commented Jan 19, 2018

/sig windows
/kind bug

@feiskyer

This comment has been minimized.

Member

feiskyer commented Jan 19, 2018

Before this PR, windows kernel version is 6.2.09200.192. And it is 10.0.16299.192 with this PR (this is same with ver command on windows).

@JiangtianLi

lgtm

@taylorb-microsoft

This comment has been minimized.

taylorb-microsoft commented Jan 19, 2018

There is a trade off between using the "documented API" of GetVersion() and also needing the manifest vs using the registry, which could change.

That said - I think this is right balance for users thus.

LGTM

@feiskyer feiskyer assigned yujuhong and unassigned yifan-gu Jan 23, 2018

@feiskyer

This comment has been minimized.

Member

feiskyer commented Jan 23, 2018

@yujuhong

This comment has been minimized.

Contributor

yujuhong commented Jan 24, 2018

/approve

@feiskyer

This comment has been minimized.

Member

feiskyer commented Jan 24, 2018

@taylorb-microsoft @yujuhong Thanks of reviewing. Could you also lgtm to the PR?

@yujuhong

This comment has been minimized.

Contributor

yujuhong commented Jan 26, 2018

/lgtm based on the windows folks' reviews above.

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Jan 26, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, yujuhong

Associated issue: #55143

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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@feiskyer

This comment has been minimized.

Member

feiskyer commented Jan 29, 2018

/lgtm based on the windows folks' reviews above.

@yujuhong Seems bot not responded. Could you help adding the label again?

@yujuhong yujuhong added the lgtm label Jan 29, 2018

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Jan 29, 2018

/test all

Tests are more than 96 hours old. Re-running tests.

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Jan 29, 2018

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 here.

@k8s-merge-robot k8s-merge-robot merged commit 30c14dd into kubernetes:master Jan 29, 2018

15 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation feiskyer authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-gke-gci Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-e2e-kubeadm-gce-canary Skipped
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-unit Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@feiskyer feiskyer deleted the feiskyer:win-ver branch Jan 30, 2018

k8s-merge-robot added a commit that referenced this pull request Feb 2, 2018

Merge pull request #59003 from feiskyer/automated-cherry-pick-of-#58498
…-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #58498: Get windows kernel version directly from registry

Cherry pick of #58498 on release-1.9.

#58498: Get windows kernel version directly from registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment