diff --git a/cmd/influxd/run/config.go b/cmd/influxd/run/config.go index f3e4be2ef7..27b6f35f42 100644 --- a/cmd/influxd/run/config.go +++ b/cmd/influxd/run/config.go @@ -140,6 +140,16 @@ func (c *Config) FromToml(input string) error { log.Printf("deprecated config option %s replaced with %s; %s will not be supported in a future release\n", in, out, in) return out }) + + // Replace deprecated [cluster] with [coordinator] + re = regexp.MustCompile(`(?m)^\s*\[(cluster)\]`) + input = re.ReplaceAllStringFunc(input, func(in string) string { + in = strings.TrimSpace(in) + out := "[coordinator]" + log.Printf("deprecated config option %s replaced with %s; %s will not be supported in a future release\n", in, out, in) + return out + }) + _, err := toml.Decode(input, c) return err } diff --git a/cmd/influxd/run/config_test.go b/cmd/influxd/run/config_test.go index 725977ba02..030088e263 100644 --- a/cmd/influxd/run/config_test.go +++ b/cmd/influxd/run/config_test.go @@ -252,6 +252,9 @@ bind-address = ":1000" [opentsdb] bind-address = ":2000" + +[cluster] +max-select-point = 100 `); err != nil { t.Fatal(err) } @@ -261,5 +264,8 @@ bind-address = ":2000" t.Fatalf("unexpected collectd bind address: %s", c.CollectdInputs[0].BindAddress) } else if c.OpenTSDBInputs[0].BindAddress != ":2000" { t.Fatalf("unexpected opentsdb bind address: %s", c.OpenTSDBInputs[0].BindAddress) + } else if c.Coordinator.MaxSelectPointN != 100 { + t.Fatalf("unexpected coordinator max select points: %s", c.Coordinator.MaxSelectPointN) + } }