Merge pull request #3820 from giggsoff/fix-riscv64-arch

Add all valid arches to ImageLoad
This commit is contained in:
Avi Deitcher 2022-09-08 14:16:03 +03:00 committed by GitHub
commit 9b636cbf25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ import (
"strings" "strings"
"github.com/containerd/containerd/reference" "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/authn"
"github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1" 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) tr = tar.NewReader(r)
index bytes.Buffer index bytes.Buffer
) )
var suffix string if !util.IsValidOSArch(linux, architecture, "") {
switch architecture { return ImageSource{}, fmt.Errorf("unknown arch %s", architecture)
case "amd64", "arm64", "s390x":
suffix = "-" + architecture
default:
return ImageSource{}, fmt.Errorf("Unknown arch %q", architecture)
} }
suffix := "-" + architecture
imageName := ref.String() + suffix imageName := ref.String() + suffix
log.Debugf("ImageWriteTar to cache %s", imageName) log.Debugf("ImageWriteTar to cache %s", imageName)
for { for {