-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Windows: Report Version and UBR #36451
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36451 +/- ##
=========================================
Coverage ? 34.63%
=========================================
Files ? 613
Lines ? 45385
Branches ? 0
=========================================
Hits ? 15721
Misses ? 27602
Partials ? 2062 |
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.
LGTM
return ret, err | ||
} | ||
ret = windows.UTF16ToString(buf[:]) | ||
ret = fmt.Sprintf("%s, Update Build Revision %d", ret, ubr) |
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.
The format looks okay, and should look like this for Windows Server 1709:
Windows Server Standard Version 1709, Update Build Revision 248
However, did you consider something more consistent with winver.exe
?
Windows Server Standard Version 1709 (OS Build 16299.248)
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.
Sure updated.
Client (RS4 Pre-release)
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17114 (17114.1000.amd64fre.rs4_release_base.180301-1503)
Operating System: Windows 10 Enterprise Insider Preview Version 1803 (OS Build 17114.1000)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 15.93GiB
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.
And server RS3
Default Isolation: process
Kernel Version: 10.0 16299 (16299.248.amd64fre.rs3_release_svc_escrow.180209-1727)
Operating System: Windows Server Datacenter Version 1709 (OS Build 16299.248)
OSType: windows
Architecture: x86_64
CPUs: 32
Total Memory: 16.01GiB
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.
LGTM
ping @salah-khan PTAL
0, | ||
windows.KEY_READ, | ||
&h); err != nil { | ||
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\WIndows NT\CurrentVersion`, registry.QUERY_VALUE) |
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 pkg/parsers/kernel/
also be updated to use the registry
package?
moby/pkg/parsers/kernel/kernel_windows.go
Lines 33 to 53 in 4f0d95f
if err = windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, | |
windows.StringToUTF16Ptr(`SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\`), | |
0, | |
windows.KEY_READ, | |
&h); err != nil { | |
return KVI, err | |
} | |
defer windows.RegCloseKey(h) | |
var buf [1 << 10]uint16 | |
var typ uint32 | |
n := uint32(len(buf) * 2) // api expects array of bytes, not uint16 | |
if err = windows.RegQueryValueEx(h, | |
windows.StringToUTF16Ptr("BuildLabEx"), | |
nil, | |
&typ, | |
(*byte)(unsafe.Pointer(&buf[0])), | |
&n); err != nil { | |
return KVI, err | |
} |
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.
Sure but orthogonal to this PR itself. Can be addressed as a follow-up
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.
oh, definitely not needed in this PR 👍
Actually, let's move this back to design review for a bit, so that we can discuss @johnstep's suggestion for the format #36451 (comment) |
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard jhoward@microsoft.com
@johnstep as talked about offline. Reports back the ReleaseID (aka Version) and UBR in the operating system string reported by Docker Info. Also switches this to use the golang built in registry reader rather than direct API while I was there.