bump manifest-tool to latest

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2021-06-15 20:28:44 +03:00
parent acc34e5ee3
commit 873f61e695
6 changed files with 73 additions and 46 deletions

View File

@ -20,7 +20,7 @@ require (
github.com/docker/cli v20.10.0-beta1+incompatible
github.com/docker/docker v17.12.0-ce-rc1.0.20200116195852-71e07f91307a+incompatible
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/estesp/manifest-tool v1.0.4-0.20201218012658-2d360eeba276
github.com/estesp/manifest-tool v1.0.4-0.20210209183109-dd311423107e
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-containerregistry v0.4.1-0.20210208222243-cbafe638a7a9
github.com/google/uuid v1.1.1

View File

@ -180,6 +180,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/estesp/manifest-tool v1.0.4-0.20201218012658-2d360eeba276 h1:1wNgB5QKQ+/0cIVJPCdaTo9bXW/2RZG+IlrpasRbTXE=
github.com/estesp/manifest-tool v1.0.4-0.20201218012658-2d360eeba276/go.mod h1:4jExvdppkxmwr9pslitpwwJB0c8bBNK+UE0B4UK9GSk=
github.com/estesp/manifest-tool v1.0.4-0.20210209183109-dd311423107e h1:IxLhZ22ibyDv3NQdoxa3GE2FoGpdYmfHYNpfbLTQCsE=
github.com/estesp/manifest-tool v1.0.4-0.20210209183109-dd311423107e/go.mod h1:4jExvdppkxmwr9pslitpwwJB0c8bBNK+UE0B4UK9GSk=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=

View File

@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"path/filepath"
"github.com/docker/distribution/reference"
"github.com/estesp/manifest-tool/pkg/store"
@ -23,7 +22,7 @@ func PushManifestList(username, password string, input types.YAMLInput, ignoreMi
var configDirs []string
if configDir != "" {
configDirs = append(configDirs, filepath.Join(configDir, "config.json"))
configDirs = append(configDirs, configDir)
}
resolver := util.NewResolver(username, password, insecure,
plainHttp, configDirs...)

View File

@ -2,51 +2,41 @@ package util
import "fmt"
// list of valid os/arch values (see "Optional Environment Variables" section
// of https://golang.org/doc/install/source
var validOSArch = map[string]bool{
"darwin/386": true,
"darwin/amd64": true,
"darwin/arm": true,
"darwin/arm64": true,
"dragonfly/amd64": true,
"freebsd/386": true,
"freebsd/amd64": true,
"freebsd/arm": true,
"linux/386": true,
"linux/amd64": true,
"linux/arm": true,
"linux/arm/v5": true,
"linux/arm/v6": true,
"linux/arm/v7": true,
"linux/arm64": true,
"linux/arm64/v8": true,
"linux/ppc64": true,
"linux/ppc64le": true,
"linux/mips64": true,
"linux/mips64le": true,
"linux/s390x": true,
"netbsd/386": true,
"netbsd/amd64": true,
"netbsd/arm": true,
"openbsd/386": true,
"openbsd/amd64": true,
"openbsd/arm": true,
"plan9/386": true,
"plan9/amd64": true,
"solaris/amd64": true,
"windows/386": true,
"windows/amd64": true,
"windows/arm": true,
}
//go:generate go run osgen.go
var (
armVariants = map[string]bool{
"v5": true,
"v6": true,
"v7": true,
}
)
// IsValidOSArch checks against the generated list of os/arch combinations
// from Go as well as checking for valid variants for ARM (the only architecture that uses variants)
func IsValidOSArch(os string, arch string, variant string) bool {
osarch := fmt.Sprintf("%s/%s", os, arch)
if variant != "" {
osarch = fmt.Sprintf("%s/%s/%s", os, arch, variant)
if _, ok := validOS[os]; !ok {
return false
}
if _, ok := validArch[arch]; !ok {
return false
}
if variant == "" {
return true
}
_, ok := validOSArch[osarch]
// only arm/arm64 can use variant
switch osarch {
case "linux/arm":
_, ok := armVariants[variant]
return ok
case "linux/arm64":
if variant == "v8" {
return true
}
default:
return false
}
return false
}

View File

@ -0,0 +1,36 @@
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at
// 2021-02-09 13:11:28.537236306 -0500 EST m=+0.034330659
// using data from 'go tool dist list'
package util
var validOS = map[string]bool{
"darwin": true,
"dragonfly": true,
"illumos": true,
"js": true,
"netbsd": true,
"plan9": true,
"aix": true,
"android": true,
"windows": true,
"openbsd": true,
"solaris": true,
"freebsd": true,
"linux": true,
}
var validArch = map[string]bool{
"wasm": true,
"mips": true,
"mips64le": true,
"mipsle": true,
"ppc64le": true,
"amd64": true,
"arm64": true,
"arm": true,
"mips64": true,
"riscv64": true,
"s390x": true,
"ppc64": true,
"386": true,
}

View File

@ -218,7 +218,7 @@ github.com/docker/go-metrics
github.com/docker/go-units
# github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
## explicit
# github.com/estesp/manifest-tool v1.0.4-0.20201218012658-2d360eeba276
# github.com/estesp/manifest-tool v1.0.4-0.20210209183109-dd311423107e
## explicit
github.com/estesp/manifest-tool/pkg/registry
github.com/estesp/manifest-tool/pkg/store