mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Rework default config generation to not use toml
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
||||
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/config"
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
|
||||
"github.com/pelletier/go-toml"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@@ -126,12 +125,10 @@ func (opts options) getFormattedConfig() ([]byte, error) {
|
||||
}
|
||||
|
||||
buffer := bytes.NewBuffer(nil)
|
||||
enc := toml.NewEncoder(buffer).Indentation("")
|
||||
|
||||
if err := enc.Encode(cfg); err != nil {
|
||||
return nil, fmt.Errorf("invalid config: %v", err)
|
||||
if _, err := cfg.Save(buffer); err != nil {
|
||||
return nil, fmt.Errorf("unable to save config: %v", err)
|
||||
}
|
||||
|
||||
return fixComments(buffer.Bytes())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user