agent: anti-entropy sync services/checks if they don't exist in the catalog

pull/850/head
Ryan Uber 10 years ago
parent e5797d9a86
commit a60f4adf95

@ -316,6 +316,13 @@ func (l *localState) setSyncState() error {
l.Lock()
defer l.Unlock()
for id, _ := range l.services {
// If the local service doesn't exist remotely, then sync it
if _, ok := services.Services[id]; !ok {
l.serviceStatus[id] = syncStatus{inSync: false}
}
}
if services != nil {
for id, service := range services.Services {
// If we don't have the service locally, deregister it
@ -331,6 +338,16 @@ func (l *localState) setSyncState() error {
}
}
for id, _ := range l.checks {
// Sync any check which doesn't exist on the remote side
for _, check := range checks {
if check.CheckID == id {
continue
}
l.checkStatus[id] = syncStatus{inSync: false}
}
}
for _, check := range checks {
// If we don't have the check locally, deregister it
id := check.CheckID

Loading…
Cancel
Save