Convert deprecated [cluster] config to [coordinator]
parent
6cc1a34704
commit
75e89e35d8
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue