mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit 6bd81372ad6f (v0.13.0-dev)
full diff: 6bd81372ad...d6e142600e
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
20
vendor/github.com/moby/buildkit/util/entitlements/entitlements.go
generated
vendored
20
vendor/github.com/moby/buildkit/util/entitlements/entitlements.go
generated
vendored
@ -58,3 +58,23 @@ func (s Set) Allowed(e Entitlement) bool {
|
||||
_, ok := s[e]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (s Set) Check(v Values) error {
|
||||
if v.NetworkHost {
|
||||
if !s.Allowed(EntitlementNetworkHost) {
|
||||
return errors.Errorf("%s is not allowed", EntitlementNetworkHost)
|
||||
}
|
||||
}
|
||||
|
||||
if v.SecurityInsecure {
|
||||
if !s.Allowed(EntitlementSecurityInsecure) {
|
||||
return errors.Errorf("%s is not allowed", EntitlementSecurityInsecure)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Values struct {
|
||||
NetworkHost bool
|
||||
SecurityInsecure bool
|
||||
}
|
||||
|
Reference in New Issue
Block a user