mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-24 20:28:02 +08:00
support for device entitlement in build and bake
Allow access to CDI Devices in Buildkit v0.20.0+ for devices that are not automatically allowed to be used by everyone in BuildKit configuration. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -208,8 +208,8 @@ func TestValidateEntitlements(t *testing.T) {
|
||||
{
|
||||
name: "NetworkHostMissing",
|
||||
opt: build.Options{
|
||||
Allow: []entitlements.Entitlement{
|
||||
entitlements.EntitlementNetworkHost,
|
||||
Allow: []string{
|
||||
entitlements.EntitlementNetworkHost.String(),
|
||||
},
|
||||
},
|
||||
expected: EntitlementConf{
|
||||
@@ -223,8 +223,8 @@ func TestValidateEntitlements(t *testing.T) {
|
||||
NetworkHost: true,
|
||||
},
|
||||
opt: build.Options{
|
||||
Allow: []entitlements.Entitlement{
|
||||
entitlements.EntitlementNetworkHost,
|
||||
Allow: []string{
|
||||
entitlements.EntitlementNetworkHost.String(),
|
||||
},
|
||||
},
|
||||
expected: EntitlementConf{
|
||||
@@ -234,9 +234,9 @@ func TestValidateEntitlements(t *testing.T) {
|
||||
{
|
||||
name: "SecurityAndNetworkHostMissing",
|
||||
opt: build.Options{
|
||||
Allow: []entitlements.Entitlement{
|
||||
entitlements.EntitlementNetworkHost,
|
||||
entitlements.EntitlementSecurityInsecure,
|
||||
Allow: []string{
|
||||
entitlements.EntitlementNetworkHost.String(),
|
||||
entitlements.EntitlementSecurityInsecure.String(),
|
||||
},
|
||||
},
|
||||
expected: EntitlementConf{
|
||||
@@ -251,9 +251,9 @@ func TestValidateEntitlements(t *testing.T) {
|
||||
NetworkHost: true,
|
||||
},
|
||||
opt: build.Options{
|
||||
Allow: []entitlements.Entitlement{
|
||||
entitlements.EntitlementNetworkHost,
|
||||
entitlements.EntitlementSecurityInsecure,
|
||||
Allow: []string{
|
||||
entitlements.EntitlementNetworkHost.String(),
|
||||
entitlements.EntitlementSecurityInsecure.String(),
|
||||
},
|
||||
},
|
||||
expected: EntitlementConf{
|
||||
|
Reference in New Issue
Block a user