fix: normalize default arm64 v8 image platform
This commit is contained in:
@@ -13,6 +13,28 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInspectedImagePlatform(t *testing.T) {
|
||||
for _, tc := range []struct{ os, arch, variant, want string }{
|
||||
{"linux", "arm64", "", "linux/arm64"},
|
||||
{"linux", "arm64", "v8", "linux/arm64"},
|
||||
{"linux", "arm64", "v9", "linux/arm64/v9"},
|
||||
{"linux", "arm64", "v8.1", "linux/arm64/v8.1"},
|
||||
{"linux", "arm", "v7", "linux/arm/v7"},
|
||||
{"linux", "arm", "v8", "linux/arm/v8"},
|
||||
{"linux", "amd64", "", "linux/amd64"},
|
||||
{"linux", "amd64", "v8", "linux/amd64/v8"},
|
||||
{"", "arm64", "v8", ""},
|
||||
{"linux", "", "v8", ""},
|
||||
} {
|
||||
t.Run(tc.os+"/"+tc.arch+"/"+tc.variant, func(t *testing.T) {
|
||||
im := inspectedImage{Os: tc.os, Architecture: tc.arch, Variant: tc.variant}
|
||||
if got := im.platform(); got != tc.want {
|
||||
t.Fatalf("platform() = %q, want %q", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageLegacyMigrationNeverCertifies(t *testing.T) {
|
||||
a, sid := imageTestAPI(t, func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/v1.47/images/json" {
|
||||
|
||||
Reference in New Issue
Block a user