Skip to content

Commit e36d1a1

Browse files
committed
Add SetupCleanup test for containerd
Signed-off-by: Evan Lezar <[email protected]>
1 parent 90f06fc commit e36d1a1

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ const (
3535

3636
// Options defines the shared options for the CLIs to configure containers runtimes.
3737
type Options struct {
38-
Config string
39-
Socket string
38+
DropInConfig string
39+
Config string
40+
Socket string
4041
// ExecutablePath specifies the path to the container runtime executable.
4142
// This is used to extract the current config, for example.
4243
// If a HostRootMount is specified, this path is relative to the host root
@@ -71,8 +72,12 @@ func (o Options) Unconfigure(cfg engine.Interface) error {
7172

7273
// flush flushes the specified config to disk
7374
func (o Options) flush(cfg engine.Interface) error {
74-
logrus.Infof("Flushing config to %v", o.Config)
75-
n, err := cfg.Save(o.Config)
75+
filepath := o.DropInConfig
76+
if filepath == "" {
77+
filepath = o.Config
78+
}
79+
logrus.Infof("Flushing config to %v", filepath)
80+
n, err := cfg.Save(filepath)
7681
if err != nil {
7782
return fmt.Errorf("unable to flush config: %v", err)
7883
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func GetLowlevelRuntimePaths(o *container.Options, co *Options) ([]string, error
170170

171171
func getRuntimeConfig(o *container.Options, co *Options) (engine.Interface, error) {
172172
return containerd.New(
173-
containerd.WithPath(o.Config),
173+
containerd.WithTopLevelConfigPath(o.Config),
174174
containerd.WithConfigSource(
175175
toml.LoadFirst(
176176
containerd.CommandLineSource(o.HostRootMount, o.ExecutablePath),

0 commit comments

Comments
 (0)