From 3699177d1a7f2da84aa7426f7f7ea6c3f051a8db Mon Sep 17 00:00:00 2001 From: Petr Fedchenkov Date: Thu, 8 Sep 2022 12:14:49 +0300 Subject: [PATCH] Add all valid arches to ImageLoad We should expand the list of supported arches to be able to build them if we want. Without this we will stuck on sending tarball during build for riscv64. Signed-off-by: Petr Fedchenkov --- src/cmd/linuxkit/cache/write.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cmd/linuxkit/cache/write.go b/src/cmd/linuxkit/cache/write.go index 010483bb9..ad0abc8aa 100644 --- a/src/cmd/linuxkit/cache/write.go +++ b/src/cmd/linuxkit/cache/write.go @@ -11,6 +11,7 @@ import ( "strings" "github.com/containerd/containerd/reference" + "github.com/estesp/manifest-tool/v2/pkg/util" "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/name" v1 "github.com/google/go-containerregistry/pkg/v1" @@ -117,13 +118,10 @@ func (p *Provider) ImageLoad(ref *reference.Spec, architecture string, r io.Read tr = tar.NewReader(r) index bytes.Buffer ) - var suffix string - switch architecture { - case "amd64", "arm64", "s390x": - suffix = "-" + architecture - default: - return ImageSource{}, fmt.Errorf("Unknown arch %q", architecture) + if !util.IsValidOSArch(linux, architecture, "") { + return ImageSource{}, fmt.Errorf("unknown arch %s", architecture) } + suffix := "-" + architecture imageName := ref.String() + suffix log.Debugf("ImageWriteTar to cache %s", imageName) for {