Add engine.Config to encapsulate writing

This change adds an engine.Config type to encapsulate the writing
of config files for container engines.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2023-07-03 15:14:22 +02:00
parent bbe9742c46
commit baf94181aa
8 changed files with 82 additions and 103 deletions

View File

@@ -190,12 +190,14 @@ func (m command) configureWrapper(c *cli.Context, config *config) error {
return fmt.Errorf("unable to flush config: %v", err)
}
if n == 0 {
m.logger.Infof("Removed empty config from %v", outputPath)
} else {
m.logger.Infof("Wrote updated config to %v", outputPath)
if outputPath != "" {
if n == 0 {
m.logger.Infof("Removed empty config from %v", outputPath)
} else {
m.logger.Infof("Wrote updated config to %v", outputPath)
}
m.logger.Infof("It is recommended that %v daemon be restarted.", config.runtime)
}
m.logger.Infof("It is recommended that %v daemon be restarted.", config.runtime)
return nil
}