@@ -400,9 +400,9 @@ func testHostNetworking(t *testing.T, sb integration.Sandbox) {
400400 t .SkipNow ()
401401 }
402402 netMode := sb .Value ("netmode" )
403- var allowedEntitlements []entitlements. Entitlement
403+ var allowedEntitlements []string
404404 if netMode == hostNetwork {
405- allowedEntitlements = []entitlements. Entitlement {entitlements .EntitlementNetworkHost }
405+ allowedEntitlements = []string {entitlements .EntitlementNetworkHost . String () }
406406 }
407407 c , err := New (sb .Context (), sb .Address ())
408408 require .NoError (t , err )
@@ -1063,7 +1063,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) {
10631063 workers .CheckFeatureCompat (t , sb , workers .FeatureSecurityMode )
10641064 command := `sh -c 'cat /proc/self/status | grep CapEff | cut -f 2 > /out'`
10651065 mode := llb .SecurityModeSandbox
1066- var allowedEntitlements []entitlements. Entitlement
1066+ var allowedEntitlements []string
10671067 var assertCaps func (caps uint64 )
10681068 secMode := sb .Value ("secmode" )
10691069 if secMode == securitySandbox {
@@ -1075,7 +1075,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) {
10751075 */
10761076 require .Equal (t , uint64 (0xa80425fb ), caps )
10771077 }
1078- allowedEntitlements = []entitlements. Entitlement {}
1078+ allowedEntitlements = []string {}
10791079 } else {
10801080 assertCaps = func (caps uint64 ) {
10811081 /*
@@ -1091,7 +1091,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) {
10911091 require .Equal (t , uint64 (0x3fffffffff ), caps & 0x3fffffffff )
10921092 }
10931093 mode = llb .SecurityModeInsecure
1094- allowedEntitlements = []entitlements. Entitlement {entitlements .EntitlementSecurityInsecure }
1094+ allowedEntitlements = []string {entitlements .EntitlementSecurityInsecure . String () }
10951095 }
10961096
10971097 c , err := New (sb .Context (), sb .Address ())
@@ -1138,13 +1138,13 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
11381138 }
11391139
11401140 mode := llb .SecurityModeSandbox
1141- var allowedEntitlements []entitlements. Entitlement
1141+ var allowedEntitlements []string
11421142 secMode := sb .Value ("secmode" )
11431143 if secMode == securitySandbox {
1144- allowedEntitlements = []entitlements. Entitlement {}
1144+ allowedEntitlements = []string {}
11451145 } else {
11461146 mode = llb .SecurityModeInsecure
1147- allowedEntitlements = []entitlements. Entitlement {entitlements .EntitlementSecurityInsecure }
1147+ allowedEntitlements = []string {entitlements .EntitlementSecurityInsecure . String () }
11481148 }
11491149
11501150 c , err := New (sb .Context (), sb .Address ())
@@ -1191,7 +1191,7 @@ func testSecurityModeErrors(t *testing.T, sb integration.Sandbox) {
11911191 require .NoError (t , err )
11921192
11931193 _ , err = c .Solve (sb .Context (), def , SolveOpt {
1194- AllowedEntitlements : []entitlements. Entitlement {entitlements .EntitlementSecurityInsecure },
1194+ AllowedEntitlements : []string {entitlements .EntitlementSecurityInsecure . String () },
11951195 }, nil )
11961196 require .Error (t , err )
11971197 require .Contains (t , err .Error (), "security.insecure is not allowed" )
@@ -11054,22 +11054,26 @@ func testCDI(t *testing.T, sb integration.Sandbox) {
1105411054 defer c .Close ()
1105511055
1105611056 require .NoError (t , os .WriteFile (filepath .Join (sb .CDISpecDir (), "vendor1-device.yaml" ), []byte (`
11057- cdiVersion: "0.3 .0"
11057+ cdiVersion: "0.6 .0"
1105811058kind: "vendor1.com/device"
1105911059devices:
1106011060- name: foo
1106111061 containerEdits:
1106211062 env:
1106311063 - FOO=injected
11064+ annotations:
11065+ org.mobyproject.buildkit.device.autoallow: true
1106411066` ), 0600 ))
1106511067 require .NoError (t , os .WriteFile (filepath .Join (sb .CDISpecDir (), "vendor2-device.yaml" ), []byte (`
11066- cdiVersion: "0.3 .0"
11068+ cdiVersion: "0.6 .0"
1106711069kind: "vendor2.com/device"
1106811070devices:
1106911071- name: bar
1107011072 containerEdits:
1107111073 env:
1107211074 - BAR=injected
11075+ annotations:
11076+ org.mobyproject.buildkit.device.autoallow: true
1107311077` ), 0600 ))
1107411078
1107511079 busybox := llb .Image ("busybox:latest" )
@@ -11119,7 +11123,7 @@ func testCDIFirst(t *testing.T, sb integration.Sandbox) {
1111911123 defer c .Close ()
1112011124
1112111125 require .NoError (t , os .WriteFile (filepath .Join (sb .CDISpecDir (), "vendor1-device.yaml" ), []byte (`
11122- cdiVersion: "0.3 .0"
11126+ cdiVersion: "0.6 .0"
1112311127kind: "vendor1.com/device"
1112411128devices:
1112511129- name: foo
@@ -11138,6 +11142,8 @@ devices:
1113811142 containerEdits:
1113911143 env:
1114011144 - QUX=injected
11145+ annotations:
11146+ org.mobyproject.buildkit.device.autoallow: true
1114111147` ), 0600 ))
1114211148
1114311149 busybox := llb .Image ("busybox:latest" )
@@ -11184,7 +11190,7 @@ func testCDIWildcard(t *testing.T, sb integration.Sandbox) {
1118411190 defer c .Close ()
1118511191
1118611192 require .NoError (t , os .WriteFile (filepath .Join (sb .CDISpecDir (), "vendor1-device.yaml" ), []byte (`
11187- cdiVersion: "0.3 .0"
11193+ cdiVersion: "0.6 .0"
1118811194kind: "vendor1.com/device"
1118911195devices:
1119011196- name: foo
@@ -11195,6 +11201,8 @@ devices:
1119511201 containerEdits:
1119611202 env:
1119711203 - BAR=injected
11204+ annotations:
11205+ org.mobyproject.buildkit.device.autoallow: true
1119811206` ), 0600 ))
1119911207
1120011208 busybox := llb .Image ("busybox:latest" )
@@ -11243,6 +11251,7 @@ cdiVersion: "0.6.0"
1124311251kind: "vendor1.com/device"
1124411252annotations:
1124511253 foo.bar.baz: FOO
11254+ org.mobyproject.buildkit.device.autoallow: true
1124611255devices:
1124711256- name: foo
1124811257 annotations:
0 commit comments