Skip to content

Commit e3ee691

Browse files
committed
[nvidia-ctk-installer] do not revert cri-o config when nvidia is not default runtime
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent fae680c commit e3ee691

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cmd/nvidia-ctk-installer/container/runtime/crio/config_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ func TestCrioConfigLifecycle(t *testing.T) {
8888
},
8989
assertCleanupPostConditions: func(t *testing.T, co *container.Options, _ *Options) error {
9090
require.NoFileExists(t, co.TopLevelConfigPath)
91-
require.NoFileExists(t, co.DropInConfig)
9291
return nil
9392
},
9493
},
@@ -182,8 +181,6 @@ signature_policy = "/etc/crio/policy.json"
182181
assertCleanupPostConditions: func(t *testing.T, co *container.Options, o *Options) error {
183182
require.FileExists(t, co.TopLevelConfigPath)
184183

185-
require.NoFileExists(t, co.DropInConfig)
186-
187184
actualTopLevel, err := os.ReadFile(co.TopLevelConfigPath)
188185
require.NoError(t, err)
189186

@@ -480,8 +477,6 @@ plugin_dirs = [
480477
`
481478
require.Equal(t, expected, string(actual))
482479

483-
require.NoFileExists(t, co.DropInConfig)
484-
485480
return nil
486481
},
487482
},

cmd/nvidia-ctk-installer/container/runtime/crio/crio.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ func cleanupHook(co *Options) error {
180180

181181
// cleanupConfig removes the NVIDIA container runtime from the cri-o config
182182
func cleanupConfig(o *container.Options) error {
183+
if !o.SetAsDefault {
184+
return nil
185+
}
186+
183187
log.Infof("Reverting config file modifications")
184188

185189
cfg, err := getRuntimeConfig(o)

0 commit comments

Comments
 (0)