mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
Always create a consul.Syncer. Use a default Consul Config if necessary.
This commit is contained in:
@@ -111,7 +111,14 @@ type Syncer struct {
|
||||
func NewSyncer(config *config.ConsulConfig, shutdownCh chan struct{}, logger *log.Logger) (*Syncer, error) {
|
||||
var err error
|
||||
var c *consul.Client
|
||||
|
||||
cfg := consul.DefaultConfig()
|
||||
|
||||
// If a nil config was provided, fall back to the default config
|
||||
if config == nil {
|
||||
config = cfg
|
||||
}
|
||||
|
||||
if config.Addr != "" {
|
||||
cfg.Address = config.Addr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user