mirror of
https://github.com/containers/skopeo.git
synced 2025-09-22 10:27:08 +00:00
Update non-module dependencies
Dependabot was apparently not picking these up (and several haven't had a release for a long time anyway). Also move from github.com/go-check/check to its newly declared (and go.mod-enforced) name gopkg.in/check.v1. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
31
vendor/github.com/opencontainers/image-spec/schema/validator.go
generated
vendored
31
vendor/github.com/opencontainers/image-spec/schema/validator.go
generated
vendored
@@ -23,7 +23,7 @@ import (
|
||||
"regexp"
|
||||
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
"github.com/opencontainers/image-spec/specs-go/v1"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/xeipuuv/gojsonschema"
|
||||
)
|
||||
@@ -168,6 +168,7 @@ func validateIndex(r io.Reader) error {
|
||||
}
|
||||
if manifest.Platform != nil {
|
||||
checkPlatform(manifest.Platform.OS, manifest.Platform.Architecture)
|
||||
checkArchitecture(manifest.Platform.Architecture, manifest.Platform.Variant)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -189,6 +190,7 @@ func validateConfig(r io.Reader) error {
|
||||
}
|
||||
|
||||
checkPlatform(header.OS, header.Architecture)
|
||||
checkArchitecture(header.Architecture, header.Variant)
|
||||
|
||||
envRegexp := regexp.MustCompile(`^[^=]+=.*$`)
|
||||
for _, e := range header.Config.Env {
|
||||
@@ -200,6 +202,31 @@ func validateConfig(r io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkArchitecture(Architecture string, Variant string) {
|
||||
validCombins := map[string][]string{
|
||||
"arm": {"", "v6", "v7", "v8"},
|
||||
"arm64": {"", "v8"},
|
||||
"386": {""},
|
||||
"amd64": {""},
|
||||
"ppc64": {""},
|
||||
"ppc64le": {""},
|
||||
"mips64": {""},
|
||||
"mips64le": {""},
|
||||
"s390x": {""},
|
||||
}
|
||||
for arch, variants := range validCombins {
|
||||
if arch == Architecture {
|
||||
for _, variant := range variants {
|
||||
if variant == Variant {
|
||||
return
|
||||
}
|
||||
}
|
||||
fmt.Printf("warning: combination of architecture %q and variant %q is not valid.\n", Architecture, Variant)
|
||||
}
|
||||
}
|
||||
fmt.Printf("warning: architecture %q is not supported yet.\n", Architecture)
|
||||
}
|
||||
|
||||
func checkPlatform(OS string, Architecture string) {
|
||||
validCombins := map[string][]string{
|
||||
"android": {"arm"},
|
||||
@@ -219,7 +246,7 @@ func checkPlatform(OS string, Architecture string) {
|
||||
return
|
||||
}
|
||||
}
|
||||
fmt.Printf("warning: combination of %q and %q is invalid.\n", OS, Architecture)
|
||||
fmt.Printf("warning: combination of os %q and architecture %q is invalid.\n", OS, Architecture)
|
||||
}
|
||||
}
|
||||
fmt.Printf("warning: operating system %q of the bundle is not supported yet.\n", OS)
|
||||
|
Reference in New Issue
Block a user