Skip to content

Commit

Permalink
fix: proper default 2.x config filename
Browse files Browse the repository at this point in the history
  • Loading branch information
alespour committed Oct 20, 2020
1 parent b63bcb4 commit 77b577e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/influxd/upgrade/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func upgradeConfig(configFile string, targetOptions optionsV2, log *zap.Logger)
cu.updateV2Config(cTransformed, targetOptions)

// save new config
configFileV2 := strings.TrimSuffix(configFile, filepath.Ext(configFile)) + ".toml"
configFileV2 := filepath.Join(filepath.Dir(configFile), "config.toml")
configFileV2, err = cu.save(cTransformed, configFileV2)
if err != nil {
return nil, err
Expand Down
3 changes: 1 addition & 2 deletions cmd/influxd/upgrade/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -80,7 +79,7 @@ func TestConfigUpgrade(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
configFile := testCreateTempFile(t, "influxdb-*.conf", tc.config1x)
configFileV2 := strings.TrimSuffix(configFile, filepath.Ext(configFile)) + ".toml"
configFileV2 := filepath.Join(filepath.Dir(configFile), "config.toml")
defer func() {
os.Remove(configFile)
os.Remove(configFileV2)
Expand Down

0 comments on commit 77b577e

Please sign in to comment.