Merge pull request #724 from zoli/master

Support multiple recursor flag
This commit is contained in:
Ryan Uber 2015-02-23 09:27:25 -08:00
commit e98b0edab4
1 changed files with 5 additions and 0 deletions

View File

@ -56,11 +56,13 @@ func (c *Command) readConfig() *Config {
var configFiles []string var configFiles []string
var retryInterval string var retryInterval string
var retryIntervalWan string var retryIntervalWan string
var dnsRecursors []string
cmdFlags := flag.NewFlagSet("agent", flag.ContinueOnError) cmdFlags := flag.NewFlagSet("agent", flag.ContinueOnError)
cmdFlags.Usage = func() { c.Ui.Output(c.Help()) } cmdFlags.Usage = func() { c.Ui.Output(c.Help()) }
cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-file", "json file to read config from") cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-file", "json file to read config from")
cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-dir", "directory of json files to read") cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-dir", "directory of json files to read")
cmdFlags.Var((*AppendSliceValue)(&dnsRecursors), "recursor", "address of an upstream DNS server")
cmdFlags.StringVar(&cmdConfig.LogLevel, "log-level", "", "log level") cmdFlags.StringVar(&cmdConfig.LogLevel, "log-level", "", "log level")
cmdFlags.StringVar(&cmdConfig.NodeName, "node", "", "node name") cmdFlags.StringVar(&cmdConfig.NodeName, "node", "", "node name")
@ -138,6 +140,8 @@ func (c *Command) readConfig() *Config {
config = MergeConfig(config, fileConfig) config = MergeConfig(config, fileConfig)
} }
cmdConfig.DNSRecursors = append(cmdConfig.DNSRecursors, dnsRecursors...)
config = MergeConfig(config, &cmdConfig) config = MergeConfig(config, &cmdConfig)
if config.NodeName == "" { if config.NodeName == "" {
@ -857,6 +861,7 @@ Options:
as configuration in this directory in alphabetical as configuration in this directory in alphabetical
order. order.
-data-dir=path Path to a data directory to store agent state -data-dir=path Path to a data directory to store agent state
-recursor Address of an upstream DNS server
-dc=east-aws Datacenter of the agent -dc=east-aws Datacenter of the agent
-encrypt=key Provides the gossip encryption key -encrypt=key Provides the gossip encryption key
-join=1.2.3.4 Address of an agent to join at start time. -join=1.2.3.4 Address of an agent to join at start time.