From c30339070e89e0c8893b0ea3c5d6379e6042347f Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Wed, 13 Apr 2022 23:12:58 -0300 Subject: [PATCH] fix(snap): incorrect skip due go GOAMD64 the valid arch check was not considering GOAMD64 refs #3016 Signed-off-by: Carlos A Becker --- internal/pipe/snapcraft/snapcraft.go | 5 ++++- internal/pipe/snapcraft/snapcraft_test.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go index 6910f9269..2c16d4149 100644 --- a/internal/pipe/snapcraft/snapcraft.go +++ b/internal/pipe/snapcraft/snapcraft.go @@ -187,7 +187,10 @@ func doRun(ctx *context.Context, snap config.Snapcraft) error { func isValidArch(arch string) bool { // https://snapcraft.io/docs/architectures - for _, a := range []string{"s390x", "ppc64el", "arm64", "armhf", "amd64", "i386"} { + if strings.HasPrefix(arch, "amd64") { + return true + } + for _, a := range []string{"s390x", "ppc64el", "arm64", "armhf", "i386"} { if arch == a { return true } diff --git a/internal/pipe/snapcraft/snapcraft_test.go b/internal/pipe/snapcraft/snapcraft_test.go index ef99d9ae6..6077a77c5 100644 --- a/internal/pipe/snapcraft/snapcraft_test.go +++ b/internal/pipe/snapcraft/snapcraft_test.go @@ -659,7 +659,10 @@ func Test_isValidArch(t *testing.T) { {"ppc64el", true}, {"arm64", true}, {"armhf", true}, - {"amd64", true}, + {"amd64v1", true}, + {"amd64v2", true}, + {"amd64v3", true}, + {"amd64v4", true}, {"i386", true}, {"mips", false}, {"armel", false},