Skip to content

Commit 10b8a9a

Browse files
committed
Set config file path when running containerd config dump
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent be415a8 commit 10b8a9a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func getRuntimeConfig(o *container.Options, co *Options) (engine.Interface, erro
176176
containerd.WithTopLevelConfigPath(o.TopLevelConfigPath),
177177
containerd.WithConfigSource(
178178
toml.LoadFirst(
179-
containerd.CommandLineSource(o.HostRootMount, o.ExecutablePath),
179+
containerd.CommandLineSource(o.HostRootMount, o.ExecutablePath, o.TopLevelConfigPath),
180180
toml.FromFile(o.TopLevelConfigPath),
181181
),
182182
),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func (c *config) resolveConfigSource() (toml.Loader, error) {
368368
func (c *config) getCommandConfigSource() toml.Loader {
369369
switch c.runtime {
370370
case "containerd":
371-
return containerd.CommandLineSource("", c.executablePath)
371+
return containerd.CommandLineSource("", c.executablePath, c.configFilePath)
372372
case "crio":
373373
return crio.CommandLineSource("", c.executablePath)
374374
}

pkg/config/engine/containerd/containerd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ func (c *Config) GetRuntimeConfig(name string) (engine.RuntimeConfig, error) {
195195
}
196196

197197
// CommandLineSource returns the CLI-based containerd config loader
198-
func CommandLineSource(hostRoot string, executablePath string) toml.Loader {
198+
func CommandLineSource(hostRoot string, executablePath string, topLevelConfig string) toml.Loader {
199199
if executablePath == "" {
200200
executablePath = "containerd"
201201
}
202-
return toml.FromCommandLine(chrootIfRequired(hostRoot, executablePath, "config", "dump")...)
202+
return toml.FromCommandLine(chrootIfRequired(hostRoot, executablePath, "--config", topLevelConfig, "config", "dump")...)
203203
}
204204

205205
func chrootIfRequired(hostRoot string, commandLine ...string) []string {

0 commit comments

Comments
 (0)