Skip to content

Commit

Permalink
Fix Consul Loader panic from #272
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabrasi83 committed Nov 14, 2023
1 parent 908837c commit a687572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/loaders/consul_loader/consul_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (c *consulLoader) serviceEntryToTargetConfig(se *api.ServiceEntry) (*types.
SRV:
for _, sd := range c.cfg.Services {
// match service name
if se.Service.Service == sd.Name {
if se.Service.Service != sd.Name {
continue
}

Expand Down Expand Up @@ -407,7 +407,7 @@ SRV:
return tc, nil
}

return nil, nil
return nil, errors.New("unable to find a match in Consul service(s)")
}

func (c *consulLoader) updateTargets(ctx context.Context, srvName string, tcs map[string]*types.TargetConfig, opChan chan *loaders.TargetOperation) {
Expand Down

0 comments on commit a687572

Please sign in to comment.