consul: minor CR cleanup

This commit is contained in:
Seth Hoenig
2021-04-05 09:45:55 -06:00
parent 2922839fff
commit 28038bdf47
5 changed files with 16 additions and 18 deletions

View File

@@ -282,7 +282,7 @@ WATCHER:
if !ok {
// Only warn if outside grace period to avoid races with check registration
if now.After(check.graceUntil) {
// w.logger.Warn("watched check not found in Consul", "check", check.checkName, "check_id", cid) // add back
w.logger.Warn("watched check not found in Consul", "check", check.checkName, "check_id", cid)
}
continue
}

View File

@@ -807,6 +807,10 @@ func (c *ServiceClient) sync(reason syncReason) error {
// asynchronous.
//
// Agents will be deregistered when Shutdown is called.
//
// Note: no need to manually plumb Consul namespace into the agent service registration
// or its check registrations, because the Nomad Client's Consul Client will already
// have the Nomad Client's Consul Namespace set on startup.
func (c *ServiceClient) RegisterAgent(role string, services []*structs.Service) error {
ops := operations{}
@@ -855,7 +859,7 @@ func (c *ServiceClient) RegisterAgent(role string, services []*structs.Service)
}
checkHost, checkPort = host, port
}
checkReg, err := createCheckReg(id, checkID, check, checkHost, checkPort, "") // todo ... whats up with agent namespace and its checks?
checkReg, err := createCheckReg(id, checkID, check, checkHost, checkPort, "")
if err != nil {
return fmt.Errorf("failed to add check %q: %v", check.Name, err)
}