mirror of https://github.com/hashicorp/consul
fix refactoring
parent
8e16bd7d77
commit
5f38e1148a
|
@ -607,7 +607,8 @@ func (a *Agent) reloadWatches(cfg *config.RuntimeConfig) error {
|
||||||
if raw, ok := args.([]interface{}); hasArgs && ok {
|
if raw, ok := args.([]interface{}); hasArgs && ok {
|
||||||
var parsed []string
|
var parsed []string
|
||||||
for _, arg := range raw {
|
for _, arg := range raw {
|
||||||
if v, ok := arg.(string); !ok {
|
v, ok := arg.(string)
|
||||||
|
if !ok {
|
||||||
return fmt.Errorf("Watch args must be a list of strings")
|
return fmt.Errorf("Watch args must be a list of strings")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,12 +110,12 @@ func GetDNSConfig(conf *config.RuntimeConfig) *dnsConfig {
|
||||||
func (d *DNSServer) ListenAndServe(network, addr string, notif func()) error {
|
func (d *DNSServer) ListenAndServe(network, addr string, notif func()) error {
|
||||||
mux := dns.NewServeMux()
|
mux := dns.NewServeMux()
|
||||||
mux.HandleFunc("arpa.", d.handlePtr)
|
mux.HandleFunc("arpa.", d.handlePtr)
|
||||||
mux.HandleFunc(s.domain, dhandleQuery)
|
mux.HandleFunc(d.domain, d.handleQuery)
|
||||||
if len(d.recursors) > 0 {
|
if len(d.recursors) > 0 {
|
||||||
mux.HandleFunc(".", d.handleRecurse)
|
mux.HandleFunc(".", d.handleRecurse)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Server = &dns.Server{
|
d.Server = &dns.Server{
|
||||||
Addr: addr,
|
Addr: addr,
|
||||||
Net: network,
|
Net: network,
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
|
|
Loading…
Reference in New Issue