-
Notifications
You must be signed in to change notification settings - Fork 14
Add WS2025 to Windows matcher and code optimizations #24
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,18 +42,30 @@ const ( | |
// rs5 (version 1809, codename "Redstone 5") corresponds to Windows Server | ||
// 2019 (ltsc2019), and Windows 10 (October 2018 Update). | ||
rs5 = 17763 | ||
// ltsc2019 (Windows Server 2019) is an alias for [RS5]. | ||
ltsc2019 = rs5 | ||
|
||
// v21H2Server corresponds to Windows Server 2022 (ltsc2022). | ||
v21H2Server = 20348 | ||
// ltsc2022 (Windows Server 2022) is an alias for [v21H2Server] | ||
ltsc2022 = v21H2Server | ||
|
||
// v22H2Win11 corresponds to Windows 11 (2022 Update). | ||
v22H2Win11 = 22621 | ||
|
||
// v23H2 is the 23H2 release in the Windows Server annual channel. | ||
v23H2 = 25398 | ||
akhilerm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Windows Server 2025 build 26100 | ||
v25H1Server = 26100 | ||
ltsc2025 = v25H1Server | ||
) | ||
|
||
// List of stable ABI compliant ltsc releases | ||
// Note: List must be sorted in ascending order | ||
var compatLTSCReleases = []uint16{ | ||
v21H2Server, | ||
ltsc2022, | ||
ltsc2025, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. noting that ltsc2019 is not in this set.. pls verify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @mikebrow yes this is right. ltsc2019 is not stable ABI compliant. This slice just indicates the ones that are. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesnt ABI compliance starts with ltsc2022? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nod the naming of ltsc2019 made me want to ask :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's more of a 2019 is no longer ltsc statement |
||
} | ||
|
||
// CheckHostAndContainerCompat checks if given host and container | ||
|
@@ -70,18 +82,27 @@ func checkWindowsHostAndContainerCompat(host, ctr windowsOSVersion) bool { | |
} | ||
|
||
// If host is < WS 2022, exact version match is required | ||
if host.Build < v21H2Server { | ||
if host.Build < ltsc2022 { | ||
return host.Build == ctr.Build | ||
} | ||
|
||
var supportedLtscRelease uint16 | ||
// Find the latest LTSC version that is earlier than the host version. | ||
// This is the earliest version of container that the host can run. | ||
// | ||
// If the host version is an LTSC, then it supports compatibility with | ||
// everything from the previous LTSC up to itself, so we want supportedLTSCRelease | ||
// to be the previous entry. | ||
// | ||
// If no match is found, then we know that the host is LTSC2022 exactly, | ||
// since we already checked that it's not less than LTSC2022. | ||
var supportedLTSCRelease uint16 = ltsc2022 | ||
for i := len(compatLTSCReleases) - 1; i >= 0; i-- { | ||
if host.Build >= compatLTSCReleases[i] { | ||
supportedLtscRelease = compatLTSCReleases[i] | ||
if host.Build > compatLTSCReleases[i] { | ||
supportedLTSCRelease = compatLTSCReleases[i] | ||
break | ||
} | ||
} | ||
return ctr.Build >= supportedLtscRelease && ctr.Build <= host.Build | ||
return supportedLTSCRelease <= ctr.Build && ctr.Build <= host.Build | ||
} | ||
|
||
func getWindowsOSVersion(osVersionPrefix string) windowsOSVersion { | ||
|
Uh oh!
There was an error while loading. Please reload this page.