Skip to content

Commit ecb5f5f

Browse files
authored
Add all known unreleased Debian version codenames (#1570)
1 parent 3cf0af7 commit ecb5f5f

23 files changed

+154
-230
lines changed

eng/tests/pipeline-validation/1.0/focal/amd64/Dockerfile

-1
This file was deleted.

eng/tests/pipeline-validation/1.0/focal/arm64v8/Dockerfile

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ubuntu.azurecr.io/ubuntu:noble
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ubuntu.azurecr.io/ubuntu:noble

eng/tests/pipeline-validation/README.placeholder.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ A placeholder file for testing purposes. The image tags and URLs referenced here
77
## Linux amd64 Tags
88
Tags | Dockerfile | OS Version
99
-----------| -------------| -------------
10-
focal | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/focal/amd64/Dockerfile) | Ubuntu 20.04
10+
noble | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/noble/amd64/Dockerfile) | Ubuntu 24.04
1111

1212
## Linux arm64 Tags
1313
Tags | Dockerfile | OS Version
1414
-----------| -------------| -------------
15-
focal-arm64 | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/focal/arm64v8/Dockerfile) | Ubuntu 20.04
15+
noble-arm64 | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/noble/arm64v8/Dockerfile) | Ubuntu 24.04
1616

1717
## Windows Server 2019 amd64 Tags
1818
Tag | Dockerfile

eng/tests/pipeline-validation/templates/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ A placeholder file for testing purposes. The image tags and URLs referenced here
77
## Linux amd64 Tags
88
Tags | Dockerfile | OS Version
99
-----------| -------------| -------------
10-
focal | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/focal/amd64/Dockerfile) | Ubuntu 20.04
10+
noble | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/noble/amd64/Dockerfile) | Ubuntu 24.04
1111

1212
## Linux arm64 Tags
1313
Tags | Dockerfile | OS Version
1414
-----------| -------------| -------------
15-
focal-arm64 | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/focal/arm64v8/Dockerfile) | Ubuntu 20.04
15+
noble-arm64 | [Dockerfile](https://github.com/dotnet/dotnet-docker-test/blob/main/test/pipeline-validation/1.0/noble/arm64v8/Dockerfile) | Ubuntu 24.04
1616

1717
## Windows Server 2019 amd64 Tags
1818
Tag | Dockerfile
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
$(McrTagsYmlRepo:test)
2-
$(McrTagsYmlTagGroup:focal)
3-
$(McrTagsYmlTagGroup:focal-arm64)
2+
$(McrTagsYmlTagGroup:noble)
3+
$(McrTagsYmlTagGroup:noble-arm64)
44
$(McrTagsYmlTagGroup:nanoserver-1809)

eng/tests/pipeline-validation/test-manifest.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
{
1212
"platforms": [
1313
{
14-
"dockerfile": "1.0/focal/amd64",
14+
"dockerfile": "1.0/noble/amd64",
1515
"os": "linux",
16-
"osVersion": "focal",
16+
"osVersion": "noble",
1717
"tags": {
18-
"focal": {}
18+
"noble": {}
1919
}
2020
},
2121
{
2222
"architecture": "arm64",
23-
"dockerfile": "1.0/focal/arm64v8",
23+
"dockerfile": "1.0/noble/arm64v8",
2424
"os": "linux",
25-
"osVersion": "focal",
25+
"osVersion": "noble",
2626
"tags": {
27-
"focal-arm64": {}
27+
"noble-arm64": {}
2828
},
2929
"variant": "v8"
3030
},

src/Microsoft.DotNet.ImageBuilder/src/Models/Manifest/CustomBuildLegDependencyType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum CustomBuildLegDependencyType
2525
"This means the dependent image will have its own dependency graph considered for build leg " +
2626
"generation. An example of this is when a custom build leg dependency is defined to " +
2727
"include an SDK image supported on a particular architecture in order to test a runtime OS " +
28-
"that doesn't its own SDK on that architecture (Buster ARM SDK to test Alpine ARM runtime); " +
28+
"that doesn't its own SDK on that architecture (Trixie ARM SDK to test Alpine ARM runtime); " +
2929
"in that case, the SDK will be included in a leg together with the runtime and the SDK will " +
3030
"still have have its own leg."
3131
)]

src/Microsoft.DotNet.ImageBuilder/src/ViewModel/PlatformInfo.cs

+42-111
Original file line numberDiff line numberDiff line change
@@ -156,126 +156,57 @@ public bool IsInternalFromImage(string fromImage)
156156
return _internalRepos.Any(repo => fromImage.StartsWith($"{repo}:"));
157157
}
158158

159-
public string GetOSDisplayName()
159+
public string GetOSDisplayName() => Model.OS switch
160160
{
161-
string displayName;
162-
string os = BaseOsVersion;
161+
OS.Windows => GetWindowsOSDisplayName(BaseOsVersion),
162+
_ => GetLinuxOSDisplayName(BaseOsVersion)
163+
};
163164

164-
if (Model.OS == OS.Windows)
165-
{
166-
string version = os.Split('-')[1];
167-
if (os.StartsWith("nanoserver"))
168-
{
169-
displayName = GetWindowsVersionDisplayName("Nano Server", version);
170-
}
171-
else if (os.StartsWith("windowsservercore"))
172-
{
173-
displayName = GetWindowsVersionDisplayName("Windows Server Core", version);
174-
}
175-
else
176-
{
177-
throw new NotSupportedException($"The OS version '{os}' is not supported.");
178-
}
179-
}
180-
else
165+
private static string GetWindowsOSDisplayName(string os)
166+
{
167+
string version = os.Split('-')[1];
168+
return os switch
181169
{
182-
if (os.Contains("debian"))
183-
{
184-
displayName = "Debian";
185-
}
186-
else if (os.Contains("jessie"))
187-
{
188-
displayName = "Debian 8";
189-
}
190-
else if (os.Contains("stretch"))
191-
{
192-
displayName = "Debian 9";
193-
}
194-
else if (os.Contains("buster"))
195-
{
196-
displayName = "Debian 10";
197-
}
198-
else if (os.Contains("bullseye"))
199-
{
200-
displayName = "Debian 11";
201-
}
202-
else if (os.Contains("bookworm"))
203-
{
204-
displayName = "Debian 12";
205-
}
206-
else if (os.Contains("xenial"))
207-
{
208-
displayName = "Ubuntu 16.04";
209-
}
210-
else if (os.Contains("bionic"))
211-
{
212-
displayName = "Ubuntu 18.04";
213-
}
214-
else if (os.Contains("disco"))
215-
{
216-
displayName = "Ubuntu 19.04";
217-
}
218-
else if (os.Contains("focal"))
219-
{
220-
displayName = "Ubuntu 20.04";
221-
}
222-
else if (os.Contains("hirsute"))
223-
{
224-
displayName = "Ubuntu 21.04";
225-
}
226-
else if (os.Contains("impish"))
227-
{
228-
displayName = "Ubuntu 21.10";
229-
}
230-
else if (os.Contains("jammy"))
231-
{
232-
displayName = "Ubuntu 22.04";
233-
}
234-
else if (os.Contains("noble"))
235-
{
236-
displayName = "Ubuntu 24.04";
237-
}
238-
else if (os.Contains("alpine") || os.Contains("centos") || os.Contains("fedora"))
239-
{
240-
displayName = FormatVersionableOsName(os, name => name.FirstCharToUpper());
241-
}
242-
else if (os.Contains("azurelinux"))
243-
{
244-
displayName = FormatVersionableOsName(os, name => "Azure Linux");
245-
}
246-
else if (os.Contains("cbl-mariner"))
247-
{
248-
displayName = FormatVersionableOsName(os, name => "CBL-Mariner");
249-
}
250-
else if (os.Contains("leap"))
251-
{
252-
displayName = FormatVersionableOsName(os, name => "openSUSE Leap");
253-
}
254-
else if (os.Contains("ubuntu"))
255-
{
256-
displayName = FormatVersionableOsName(os, name => "Ubuntu");
257-
}
258-
else
259-
{
260-
throw new NotSupportedException($"The OS version '{os}' is not supported.");
261-
}
262-
}
263-
264-
return displayName;
170+
var s when s.StartsWith("nanoserver") => GetWindowsVersionDisplayName("Nano Server", version),
171+
var s when s.StartsWith("windowsservercore") => GetWindowsVersionDisplayName("Windows Server Core", version),
172+
_ => throw new NotSupportedException($"The OS version '{os}' is not supported.")
173+
};
265174
}
266175

267-
private static string GetWindowsVersionDisplayName(string windowsName, string version)
176+
private static string GetLinuxOSDisplayName(string os)
268177
{
269-
if (version.StartsWith("ltsc"))
270-
{
271-
return $"{windowsName} {version.TrimStartString("ltsc")}";
272-
}
273-
else
178+
return os switch
274179
{
275-
return $"{windowsName}, version {version}";
276-
}
180+
string s when s.Contains("debian") => "Debian",
181+
string s when s.Contains("bookworm") => "Debian 12",
182+
string s when s.Contains("trixie") => "Debian 13",
183+
string s when s.Contains("forky") => "Debian 14",
184+
string s when s.Contains("duke") => "Debian 15",
185+
string s when s.Contains("jammy") => "Ubuntu 22.04",
186+
string s when s.Contains("noble") => "Ubuntu 24.04",
187+
string s when s.Contains("azurelinux") =>
188+
FormatVersionableOsName(os, name => "Azure Linux"),
189+
string s when s.Contains("cbl-mariner") =>
190+
FormatVersionableOsName(os, name => "CBL-Mariner"),
191+
string s when s.Contains("leap") =>
192+
FormatVersionableOsName(os, name => "openSUSE Leap"),
193+
string s when s.Contains("ubuntu") =>
194+
FormatVersionableOsName(os, name => "Ubuntu"),
195+
string s when s.Contains("alpine")
196+
|| s.Contains("centos")
197+
|| s.Contains("fedora") =>
198+
FormatVersionableOsName(os, name => name.FirstCharToUpper()),
199+
_ => throw new NotSupportedException($"The OS version '{os}' is not supported.")
200+
};
277201
}
278202

203+
private static string GetWindowsVersionDisplayName(string windowsName, string version) =>
204+
version.StartsWith("ltsc") switch
205+
{
206+
true => $"{windowsName} {version.TrimStartString("ltsc")}",
207+
false => $"{windowsName}, version {version}"
208+
};
209+
279210
public static bool AreMatchingPlatforms(ImageInfo image1, PlatformInfo platform1, ImageInfo image2, PlatformInfo platform2) =>
280211
platform1.GetUniqueKey(image1) == platform2.GetUniqueKey(image2);
281212

0 commit comments

Comments
 (0)