Skip to content

Commit 7386f78

Browse files
[no-relnote] rename flush to save
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent 8ef4fb2 commit 7386f78

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/config/engine/containerd/config_drop_in.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (c *ConfigWithDropIn) Save(dropInPath string) (int64, error) {
7373
}
7474

7575
// TODO: Only do this if we've actually modified the config.
76-
if err := c.topLevelConfig.flush(); err != nil {
76+
if _, err := c.topLevelConfig.Save(dropInPath); err != nil {
7777
return 0, fmt.Errorf("failed to save top-level config: %w", err)
7878
}
7979

@@ -90,12 +90,13 @@ func (c *ConfigWithDropIn) RemoveRuntime(name string) error {
9090

9191
// flush saves the top-level config to its path.
9292
// If the config is empty, the file will be deleted.
93-
func (c *topLevelConfig) flush() error {
94-
_, err := c.config.Save(c.path)
95-
if err != nil {
96-
return fmt.Errorf("failed to flush config to %q: %w", c.path, err)
93+
func (c *topLevelConfig) Save(dropInPath string) (int64, error) {
94+
saveToPath := c.path
95+
if dropInPath == "" {
96+
saveToPath = ""
9797
}
98-
return nil
98+
99+
return c.config.Save(saveToPath)
99100
}
100101

101102
func (c *topLevelConfig) simplify(dropInFilename string) {

0 commit comments

Comments
 (0)