Skip to content

Commit f64bbc3

Browse files
authored
Merge pull request #18 from sgopinath1/gpuai-5189
Remove CDI file on uninstalling package
2 parents 1651726 + 4b9f801 commit f64bbc3

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{}
@@ -115,6 +116,8 @@ func (d *dockerConfig) UnsetDefaultRuntime() error {
115116
// an error and a do not update flag in case daemon.json doesn't need
116117
// to be updated
117118
func (d *dockerConfig) RemoveRuntime(name string) (error, bool) {
119+
_ = os.RemoveAll(defaultCDISpecPath)
120+
118121
if d == nil {
119122
return fmt.Errorf("configuration is empty"), true
120123
}

0 commit comments

Comments
 (0)