2021-04-09 14:20:26 +08:00
|
|
|
package buildflags
|
2019-07-09 06:58:38 +08:00
|
|
|
|
2023-06-23 16:44:30 +08:00
|
|
|
import "github.com/moby/buildkit/util/entitlements"
|
2019-07-09 06:58:38 +08:00
|
|
|
|
|
|
|
func ParseEntitlements(in []string) ([]entitlements.Entitlement, error) {
|
|
|
|
out := make([]entitlements.Entitlement, 0, len(in))
|
|
|
|
for _, v := range in {
|
2023-06-23 16:44:30 +08:00
|
|
|
e, err := entitlements.Parse(v)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2019-07-09 06:58:38 +08:00
|
|
|
}
|
2023-06-23 16:44:30 +08:00
|
|
|
out = append(out, e)
|
2019-07-09 06:58:38 +08:00
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|