Skip to content

Commit

Permalink
Cap arm64 v8 variants at v8.9
Browse files Browse the repository at this point in the history
Signed-off-by: Chongyi Zheng <[email protected]>
  • Loading branch information
harryzcy authored and dmcgowan committed Nov 4, 2024
1 parent f21f71d commit d87bc9d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 38 additions & 0 deletions compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit d87bc9d

Please sign in to comment.