Skip to content

Commit 5a37b83

Browse files
committed
Remove CDI file on uninstall
1 parent 1651726 commit 5a37b83

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

cmd/amd-ctk/runtime/configure/configure.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ import (
2626
)
2727

2828
const (
29-
defaultRuntime = "docker"
30-
defaultAmdRuntimeName = "amd"
31-
defaultAmdRuntimeExecutable = "amd-container-runtime"
32-
defaultAmdRuntimeExecutablePath = "/usr/bin/amd-container-runtime"
33-
defaultDockerConfigFilePath = "/etc/docker/daemon.json"
29+
defaultRuntime = "docker"
30+
defaultAmdRuntimeName = "amd"
31+
defaultAmdRuntimeExecutable = "amd-container-runtime"
32+
defaultDockerConfigFilePath = "/etc/docker/daemon.json"
3433
)
3534

3635
type configOptions struct {

cmd/amd-ctk/runtime/engine/docker/docker.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import (
2424
)
2525

2626
const (
27-
runtimesKey = "runtimes"
28-
defaultRuntimeKey = "default-runtime"
29-
featuresKey = "features"
27+
runtimesKey = "runtimes"
28+
defaultRuntimeKey = "default-runtime"
29+
featuresKey = "features"
30+
defaultCDISpecPath = "/etc/cdi"
3031
)
3132

3233
type dockerConfig map[string]interface{}
@@ -138,6 +139,8 @@ func (d *dockerConfig) RemoveRuntime(name string) (error, bool) {
138139
delete(currentCfg, runtimesKey)
139140
}
140141
updated = true
142+
143+
_ = os.RemoveAll(defaultCDISpecPath)
141144
}
142145

143146
if updated {

0 commit comments

Comments
 (0)