Merge pull request #70 from tonistiigi/local-platform

platformutil: add local platform
pull/71/head
Tõnis Tiigi 6 years ago committed by GitHub
commit 84f7e9d02d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ func Parse(platformsStr []string) ([]specs.Platform, error) {
out = append(out, p...)
continue
}
p, err := platforms.Parse(s)
p, err := parse(s)
if err != nil {
return nil, err
}
@ -31,6 +31,13 @@ func Parse(platformsStr []string) ([]specs.Platform, error) {
return out, nil
}
func parse(in string) (specs.Platform, error) {
if strings.EqualFold(in, "local") {
return platforms.DefaultSpec(), nil
}
return platforms.Parse(in)
}
func Dedupe(in []specs.Platform) []specs.Platform {
m := map[string]struct{}{}
out := make([]specs.Platform, 0, len(in))

Loading…
Cancel
Save