@@ -42,18 +42,30 @@ const (
4242 // rs5 (version 1809, codename "Redstone 5") corresponds to Windows Server
4343 // 2019 (ltsc2019), and Windows 10 (October 2018 Update).
4444 rs5 = 17763
45+ // ltsc2019 (Windows Server 2019) is an alias for [RS5].
46+ ltsc2019 = rs5
4547
4648 // v21H2Server corresponds to Windows Server 2022 (ltsc2022).
4749 v21H2Server = 20348
50+ // ltsc2022 (Windows Server 2022) is an alias for [v21H2Server]
51+ ltsc2022 = v21H2Server
4852
4953 // v22H2Win11 corresponds to Windows 11 (2022 Update).
5054 v22H2Win11 = 22621
55+
56+ // v23H2 is the 23H2 release in the Windows Server annual channel.
57+ v23H2 = 25398
58+
59+ // Windows Server 2025 build 26100
60+ v25H1Server = 26100
61+ ltsc2025 = v25H1Server
5162)
5263
5364// List of stable ABI compliant ltsc releases
5465// Note: List must be sorted in ascending order
5566var compatLTSCReleases = []uint16 {
56- v21H2Server ,
67+ ltsc2022 ,
68+ ltsc2025 ,
5769}
5870
5971// CheckHostAndContainerCompat checks if given host and container
@@ -70,18 +82,27 @@ func checkWindowsHostAndContainerCompat(host, ctr windowsOSVersion) bool {
7082 }
7183
7284 // If host is < WS 2022, exact version match is required
73- if host .Build < v21H2Server {
85+ if host .Build < ltsc2022 {
7486 return host .Build == ctr .Build
7587 }
7688
77- var supportedLtscRelease uint16
89+ // Find the latest LTSC version that is earlier than the host version.
90+ // This is the earliest version of container that the host can run.
91+ //
92+ // If the host version is an LTSC, then it supports compatibility with
93+ // everything from the previous LTSC up to itself, so we want supportedLTSCRelease
94+ // to be the previous entry.
95+ //
96+ // If no match is found, then we know that the host is LTSC2022 exactly,
97+ // since we already checked that it's not less than LTSC2022.
98+ var supportedLTSCRelease uint16 = ltsc2022
7899 for i := len (compatLTSCReleases ) - 1 ; i >= 0 ; i -- {
79- if host .Build >= compatLTSCReleases [i ] {
80- supportedLtscRelease = compatLTSCReleases [i ]
100+ if host .Build > compatLTSCReleases [i ] {
101+ supportedLTSCRelease = compatLTSCReleases [i ]
81102 break
82103 }
83104 }
84- return ctr . Build >= supportedLtscRelease && ctr .Build <= host .Build
105+ return supportedLTSCRelease <= ctr . Build && ctr .Build <= host .Build
85106}
86107
87108func getWindowsOSVersion (osVersionPrefix string ) windowsOSVersion {
0 commit comments