Merge e16151f7c8 into 687feca9e8
This commit is contained in:
@@ -3,15 +3,16 @@ package buildflags
|
||||
import (
|
||||
"strings"
|
||||
|
||||
controllerapi "github.com/docker/buildx/controller/pb"
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func ParseContextNames(values []string) (map[string]string, error) {
|
||||
func ParseContextNames(values []string) (map[string]*controllerapi.NamedContext, error) {
|
||||
if len(values) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
result := make(map[string]string, len(values))
|
||||
result := make(map[string]*controllerapi.NamedContext, len(values))
|
||||
for _, value := range values {
|
||||
kv := strings.SplitN(value, "=", 2)
|
||||
if len(kv) != 2 {
|
||||
@@ -22,7 +23,7 @@ func ParseContextNames(values []string) (map[string]string, error) {
|
||||
return nil, errors.Wrapf(err, "invalid context name %s", kv[0])
|
||||
}
|
||||
name := strings.TrimSuffix(reference.FamiliarString(named), ":latest")
|
||||
result[name] = kv[1]
|
||||
result[name] = &controllerapi.NamedContext{Path: kv[1]}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user