dont process endpoint unless absolutely necessary

This commit is contained in:
Asim Aslam 2020-08-05 18:09:04 +01:00 committed by Vasiliy Tolstov
parent a4a73bac67
commit ac0f3bcbd5

View File

@ -127,7 +127,10 @@ func (r *registryRouter) store(services []*registry.Service) {
key := fmt.Sprintf("%s.%s", service.Name, sep.Name)
// decode endpoint
end := api.Decode(sep.Metadata)
// no endpoint or no name
if end == nil || len(end.Name) == 0 {
continue
}
// if we got nothing skip
if err := api.Validate(end); err != nil {
if logger.V(logger.TraceLevel, logger.DefaultLogger) {