From d87bc9df8c4a84ec54e191dc9d12ebf24a364261 Mon Sep 17 00:00:00 2001 From: Chongyi Zheng Date: Sun, 3 Nov 2024 20:54:33 -0500 Subject: [PATCH] Cap arm64 v8 variants at v8.9 Signed-off-by: Chongyi Zheng --- compare.go | 5 ++++- compare_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/compare.go b/compare.go index 317e945..0abe541 100644 --- a/compare.go +++ b/compare.go @@ -97,8 +97,11 @@ func platformVector(platform specs.Platform) []specs.Platform { }) } - // v9.0 diverged from v8.5, meaning that v9.x is compatible with v8.{x+5} + // v9.0 diverged from v8.5, meaning that v9.x is compatible with v8.{x+5} until v9.4/v8.9 armMinor = armMinor + 5 + if armMinor > 9 { + armMinor = 9 + } armMajor = 8 vector = append(vector, specs.Platform{ Architecture: platform.Architecture, diff --git a/compare_test.go b/compare_test.go index 03db1bf..ef5c2a1 100644 --- a/compare_test.go +++ b/compare_test.go @@ -185,6 +185,44 @@ func TestOnly(t *testing.T) { }, }, }, + { + platform: "linux/arm64/v9.6", + matches: map[bool][]string{ + true: { + "linux/arm", + "linux/arm/v5", + "linux/arm/v6", + "linux/arm/v7", + "linux/arm/v8", + "linux/arm64", + "linux/arm64/v8", + "linux/arm64/v8.1", + "linux/arm64/v8.2", + "linux/arm64/v8.3", + "linux/arm64/v8.4", + "linux/arm64/v8.5", + "linux/arm64/v8.6", + "linux/arm64/v8.7", + "linux/arm64/v8.8", + "linux/arm64/v8.9", + "linux/arm64/v9", + "linux/arm64/v9.0", + "linux/arm64/v9.1", + "linux/arm64/v9.2", + "linux/arm64/v9.3", + "linux/arm64/v9.4", + "linux/arm64/v9.5", + "linux/arm64/v9.6", + }, + false: { + "linux/amd64", + "linux/arm/v4", + "windows/amd64", + "windows/arm", + "linux/arm64/v8.10", // there's no v8.10 + }, + }, + }, { platform: "linux/arm64/v9", matches: map[bool][]string{