mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add required option to new toml config
This change adds a "required" option to the new toml config that controls whether a default config is returned or not. This is useful from the NVIDIA Container Runtime Hook, where /run/driver/nvidia/etc/nvidia-container-runtime/config.toml is checked before the standard path. This fixes a bug where the default config was always applied when this config was not used. See https://github.com/NVIDIA/nvidia-container-toolkit/issues/106 Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -45,6 +45,7 @@ func loadConfig() (*config.Config, error) {
|
||||
for _, p := range configPaths {
|
||||
cfg, err := config.New(
|
||||
config.WithConfigFile(p),
|
||||
config.WithRequired(true),
|
||||
)
|
||||
if err == nil {
|
||||
return cfg.Config()
|
||||
|
||||
Reference in New Issue
Block a user