Skip to content

Commit

Permalink
Merge pull request #296 from lucabrasi83/fix-consul-loader
Browse files Browse the repository at this point in the history
Fix Consul Loader panic from #272
  • Loading branch information
karimra authored Nov 14, 2023
2 parents 908837c + a687572 commit d461fa9
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 d461fa9

Please sign in to comment.