Supports MCP service configuration protocol and SNI, along with various other fixes. (#1369)

This commit is contained in:
澄潭
2024-10-09 15:54:19 +08:00
committed by GitHub
parent 3ed28f2a66
commit ecf52aecfc
23 changed files with 282 additions and 94 deletions

View File

@@ -147,7 +147,7 @@ func (w *watcher) Stop() {
log.Errorf("Failed to unsubscribe service : %v", serviceName)
continue
}
w.cache.DeleteServiceEntryWrapper(makeHost(serviceName))
w.cache.DeleteServiceWrapper(makeHost(serviceName))
}
w.UpdateService()
}
@@ -203,17 +203,18 @@ func (w *watcher) subscribe(service *fargo.Application) error {
if err != nil {
return err
}
w.cache.UpdateServiceEntryWrapper(makeHost(service.Name), &memory.ServiceEntryWrapper{
w.cache.UpdateServiceWrapper(makeHost(service.Name), &memory.ServiceWrapper{
ServiceName: service.Name,
ServiceEntry: se,
Suffix: suffix,
RegistryType: w.Type,
RegistryName: w.Name,
})
return nil
}
if w.updateCacheWhenEmpty {
w.cache.DeleteServiceEntryWrapper(makeHost(service.Name))
w.cache.DeleteServiceWrapper(makeHost(service.Name))
}
return nil