mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-13 06:57:09 +08:00
Merge pull request #2994 from tonistiigi/device-entitlements
support for device entitlement in build and bake
This commit is contained in:
@ -1,19 +1,24 @@
|
||||
package buildflags
|
||||
|
||||
import "github.com/moby/buildkit/util/entitlements"
|
||||
import (
|
||||
"log"
|
||||
|
||||
func ParseEntitlements(in []string) ([]entitlements.Entitlement, error) {
|
||||
out := make([]entitlements.Entitlement, 0, len(in))
|
||||
"github.com/moby/buildkit/util/entitlements"
|
||||
)
|
||||
|
||||
func ParseEntitlements(in []string) ([]string, error) {
|
||||
out := make([]string, 0, len(in))
|
||||
log.Printf("in: %#v", in)
|
||||
for _, v := range in {
|
||||
if v == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
e, err := entitlements.Parse(v)
|
||||
if err != nil {
|
||||
if _, _, err := entitlements.Parse(v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, e)
|
||||
out = append(out, v)
|
||||
}
|
||||
log.Printf("Parsed entitlements: %v", out)
|
||||
return out, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user