add support for consul token auth

This commit is contained in:
Naveen Achyuta
2022-08-22 12:26:35 -07:00
parent e285d3a1c5
commit e1825b4581
5 changed files with 68 additions and 18 deletions

View File

@@ -84,7 +84,7 @@ func NewMonitor(config *c.Config) *MonitorMgr {
cleanups: make(map[string]chan bool),
}
if config.Agent.ConsulAddr != "" {
cmon, err := NewConsulMon(config.Agent.ConsulAddr)
cmon, err := NewConsulMon(config.Agent.ConsulAddr, config.Agent.ConsulToken)
if err != nil {
glog.Errorf("Failed to start consul monitor: %v", err)
} else {