Skip to content

Commit f7f1774

Browse files
committed
cdi: fixes since enabled by default
Signed-off-by: CrazyMax <[email protected]>
1 parent 3adcf53 commit f7f1774

File tree

4 files changed

+9
-43
lines changed

4 files changed

+9
-43
lines changed

client/client_test.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,7 @@ func testIntegration(t *testing.T, funcs ...func(t *testing.T, sb integration.Sa
277277

278278
integration.Run(t, integration.TestFuncs(
279279
testCDI,
280-
),
281-
mirrors,
282-
integration.WithMatrix("cdi", map[string]interface{}{
283-
"enabled": enableCDI,
284-
}),
285-
)
280+
), mirrors)
286281
}
287282

288283
func newContainerd(cdAddress string) (*ctd.Client, error) {
@@ -10996,19 +10991,6 @@ func (w warningsListOutput) String() string {
1099610991
return b.String()
1099710992
}
1099810993

10999-
type cdiEnabled struct{}
11000-
11001-
func (*cdiEnabled) UpdateConfigFile(in string) string {
11002-
return in + `
11003-
[cdi]
11004-
enabled = true
11005-
`
11006-
}
11007-
11008-
var (
11009-
enableCDI integration.ConfigUpdater = &cdiEnabled{}
11010-
)
11011-
1101210994
func testCDI(t *testing.T, sb integration.Sandbox) {
1101310995
if sb.Rootless() {
1101410996
t.SkipNow()

cmd/buildkitd/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ func main() {
217217
Usage: "OTEL collector trace socket path",
218218
},
219219
cli.BoolFlag{
220-
Name: "cdi-enabled",
221-
Usage: "enables support of the Container Device Interface (CDI)",
220+
Name: "cdi-disabled",
221+
Usage: "disables support of the Container Device Interface (CDI)",
222222
},
223223
cli.StringSliceFlag{
224224
Name: "cdi-spec-dir",
@@ -631,9 +631,9 @@ func applyMainFlags(c *cli.Context, cfg *config.Config) error {
631631
cfg.OTEL.SocketPath = c.String("otel-socket-path")
632632
}
633633

634-
if c.IsSet("cdi-enabled") {
635-
cdiEnabled := c.Bool("cdi-enabled")
636-
cfg.CDI.Disabled = &cdiEnabled
634+
if c.IsSet("cdi-disabled") {
635+
cdiDisabled := c.Bool("cdi-disabled")
636+
cfg.CDI.Disabled = &cdiDisabled
637637
}
638638
if c.IsSet("cdi-spec-dir") {
639639
cfg.CDI.SpecDirs = c.StringSlice("cdi-spec-dir")

docs/buildkitd.toml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ insecure-entitlements = [ "network.host", "security.insecure" ]
4747
socketPath = "/run/buildkit/otel-grpc.sock"
4848

4949
[cdi]
50-
# Enables support of the Container Device Interface (CDI).
51-
enabled = true
50+
# Disables support of the Container Device Interface (CDI).
51+
disabled = true
5252
# List of directories to scan for CDI spec files. For more details about CDI
5353
# specification, please refer to https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md#cdi-json-specification
5454
specDirs = ["/etc/cdi", "/var/run/cdi", "/etc/buildkit/cdi"]

frontend/dockerfile/dockerfile_test.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,7 @@ func TestIntegration(t *testing.T) {
302302
"denied": networkHostDenied,
303303
}))...)
304304

305-
integration.Run(t, deviceTests, append(opts,
306-
integration.WithMatrix("cdi", map[string]interface{}{
307-
"enabled": enableCDI,
308-
}))...)
305+
integration.Run(t, deviceTests, opts...)
309306
}
310307

311308
func testEmptyStringArgInEnv(t *testing.T, sb integration.Sandbox) {
@@ -9902,19 +9899,6 @@ var (
99029899
networkHostDenied integration.ConfigUpdater = &networkModeSandbox{}
99039900
)
99049901

9905-
type cdiEnabled struct{}
9906-
9907-
func (*cdiEnabled) UpdateConfigFile(in string) string {
9908-
return in + `
9909-
[cdi]
9910-
enabled = true
9911-
`
9912-
}
9913-
9914-
var (
9915-
enableCDI integration.ConfigUpdater = &cdiEnabled{}
9916-
)
9917-
99189902
func fixedWriteCloser(wc io.WriteCloser) filesync.FileOutputFunc {
99199903
return func(map[string]string) (io.WriteCloser, error) {
99209904
return wc, nil

0 commit comments

Comments
 (0)