diff --git a/docs/user-guide/kv-config.md b/docs/user-guide/kv-config.md index 1a1008393..3b8ad9661 100644 --- a/docs/user-guide/kv-config.md +++ b/docs/user-guide/kv-config.md @@ -85,9 +85,9 @@ defaultEntryPoints = ["http", "https"] certFile = """-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----""" - keyFile = """-----BEGIN CERTIFICATE----- + keyFile = """-----BEGIN PRIVATE KEY----- - -----END CERTIFICATE-----""" + -----END PRIVATE KEY-----""" [entryPoints.other-https] address = ":4443" [entryPoints.other-https.tls] diff --git a/provider/consulcatalog/consul_catalog.go b/provider/consulcatalog/consul_catalog.go index 995542f59..e1642ae96 100644 --- a/provider/consulcatalog/consul_catalog.go +++ b/provider/consulcatalog/consul_catalog.go @@ -1,7 +1,6 @@ package consulcatalog import ( - "errors" "fmt" "strconv" "strings" @@ -156,14 +155,8 @@ func (p *Provider) watch(configurationChan chan<- types.ConfigMessage, stop chan defer close(stopCh) defer close(watchCh) - for { - select { - case <-stop: - return nil - case index, ok := <-watchCh: - if !ok { - return errors.New("consul service list nil") - } + safe.Go(func() { + for index := range watchCh { log.Debug("List of services changed") nodes, err := p.getNodes(index) if err != nil { @@ -174,6 +167,13 @@ func (p *Provider) watch(configurationChan chan<- types.ConfigMessage, stop chan ProviderName: "consul_catalog", Configuration: configuration, } + } + }) + + for { + select { + case <-stop: + return nil case err := <-errorCh: return err }