Skip to content

Commit

Permalink
cdi: fixes since enabled by default
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Feb 3, 2025
1 parent 172fbe4 commit 3f67452
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
20 changes: 1 addition & 19 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,7 @@ func testIntegration(t *testing.T, funcs ...func(t *testing.T, sb integration.Sa

integration.Run(t, integration.TestFuncs(
testCDI,
),
mirrors,
integration.WithMatrix("cdi", map[string]interface{}{
"enabled": enableCDI,
}),
)
), mirrors)
}

func newContainerd(cdAddress string) (*ctd.Client, error) {
Expand Down Expand Up @@ -11040,19 +11035,6 @@ func (w warningsListOutput) String() string {
return b.String()
}

type cdiEnabled struct{}

func (*cdiEnabled) UpdateConfigFile(in string) string {
return in + `
[cdi]
enabled = true
`
}

var (
enableCDI integration.ConfigUpdater = &cdiEnabled{}
)

func testCDI(t *testing.T, sb integration.Sandbox) {
integration.SkipOnPlatform(t, "windows")
c, err := New(sb.Context(), sb.Address())
Expand Down
4 changes: 2 additions & 2 deletions docs/buildkitd.toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ insecure-entitlements = [ "network.host", "security.insecure" ]
socketPath = "/run/buildkit/otel-grpc.sock"

[cdi]
# Enables support of the Container Device Interface (CDI).
enabled = true
# Disables support of the Container Device Interface (CDI).
disabled = true
# List of directories to scan for CDI spec files. For more details about CDI
# specification, please refer to https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md#cdi-json-specification
specDirs = ["/etc/cdi", "/var/run/cdi", "/etc/buildkit/cdi"]
Expand Down
18 changes: 1 addition & 17 deletions frontend/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,7 @@ func TestIntegration(t *testing.T) {
"denied": networkHostDenied,
}))...)

integration.Run(t, deviceTests, append(opts,
integration.WithMatrix("cdi", map[string]interface{}{
"enabled": enableCDI,
}))...)
integration.Run(t, deviceTests, opts...)
}

func testEmptyStringArgInEnv(t *testing.T, sb integration.Sandbox) {
Expand Down Expand Up @@ -9856,19 +9853,6 @@ var (
networkHostDenied integration.ConfigUpdater = &networkModeSandbox{}
)

type cdiEnabled struct{}

func (*cdiEnabled) UpdateConfigFile(in string) string {
return in + `
[cdi]
enabled = true
`
}

var (
enableCDI integration.ConfigUpdater = &cdiEnabled{}
)

func fixedWriteCloser(wc io.WriteCloser) filesync.FileOutputFunc {
return func(map[string]string) (io.WriteCloser, error) {
return wc, nil
Expand Down

0 comments on commit 3f67452

Please sign in to comment.