Skip to content

Commit

Permalink
Restore but undocument three-part version tags with arch
Browse files Browse the repository at this point in the history
  • Loading branch information
jander-msft committed Oct 4, 2024
1 parent 2dbd12f commit 4adb8b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
12 changes: 10 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9418,7 +9418,11 @@
"dockerfileTemplate": "eng/dockerfile-templates/monitor/Dockerfile.linux.extensions",
"os": "linux",
"osVersion": "azurelinux3.0-distroless",
"tags": {}
"tags": {
"$(monitor|9.0|fixed-tag)-amd64": {
"docType": "Undocumented"
}
}
},
{
"architecture": "arm64",
Expand All @@ -9429,7 +9433,11 @@
"dockerfileTemplate": "eng/dockerfile-templates/monitor/Dockerfile.linux.extensions",
"os": "linux",
"osVersion": "azurelinux3.0-distroless",
"tags": {},
"tags": {
"$(monitor|9.0|fixed-tag)-arm64v8": {
"docType": "Undocumented"
}
},
"variant": "v8"
}
]
Expand Down
18 changes: 9 additions & 9 deletions tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinorPatch,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: info => IsApplianceVersionWithoutDistroTags(info) || IsApplianceVersionWithoutArchTags(info)
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major.Minor.Patch>-<os>-<architecture>

GetTagTestInput(
Expand All @@ -301,7 +301,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinorPatch,
checkOs: false,
checkArchitecture: true,
skipDockerfileOn: info => IsApplianceVersionWithDistroTags(info) || IsApplianceVersionWithoutArchTags(info)
skipDockerfileOn: IsApplianceVersionWithDistroTags
), // <Major.Minor.Patch>-<architecture>

GetTagTestInput(
Expand All @@ -310,7 +310,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinor,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: info => IsApplianceVersionWithoutDistroTags(info) || IsApplianceVersionWithoutArchTags(info)
skipDockerfileOn: info => IsApplianceVersionWithoutDistroTags(info) || IsApplianceVersionWithMajorMinorTagsWithoutArchTags(info)
), // <Major.Minor>-<os>-<architecture>

GetTagTestInput(
Expand All @@ -328,7 +328,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinor,
checkOs: false,
checkArchitecture: true,
skipDockerfileOn: info => IsApplianceVersionWithDistroTags(info) || IsApplianceVersionWithoutArchTags(info)
skipDockerfileOn: info => IsApplianceVersionWithDistroTags(info) || IsApplianceVersionWithMajorMinorTagsWithoutArchTags(info)
), // <Major.Minor>-<architecture>

GetTagTestInput(
Expand All @@ -337,7 +337,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.Major,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: info => IsApplianceVersionWithoutDistroTags(info) || IsApplianceVersionWithoutArchTags(info)
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major>-<os>-<architecture>

GetTagTestInput(
Expand Down Expand Up @@ -533,13 +533,13 @@ private static object[] GetTagTestInput(
private static bool IsWindows(ManifestHelper.DockerfileInfo dockerfileInfo) =>
dockerfileInfo.Os.Contains("windowsservercore") || dockerfileInfo.Os.Contains("nanoserver");

// All appliance-style images do not have arch-specific tags starting with version 9
private static bool IsApplianceVersionWithArchTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
// All appliance-style images do not have arch-specific tags for <major>.<minor> tags starting with version 9
private static bool IsApplianceVersionWithMajorMinorTagsWithArchTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
(dockerfileInfo.Repo.Contains("monitor") && GetVersion(dockerfileInfo.MajorMinor).Major <= 8) ||
(dockerfileInfo.Repo.Contains("aspire") && GetVersion(dockerfileInfo.MajorMinor).Major <= 8);

private static bool IsApplianceVersionWithoutArchTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
!IsApplianceVersionWithArchTags(dockerfileInfo);
private static bool IsApplianceVersionWithMajorMinorTagsWithoutArchTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
!IsApplianceVersionWithMajorMinorTagsWithArchTags(dockerfileInfo);

// Certain versions of appliance repos use a new tag schema.
// This new schema excludes the OS from all tags.
Expand Down

0 comments on commit 4adb8b6

Please sign in to comment.