Skip to content

Commit

Permalink
Fix nil map access of endpoint labels
Browse files Browse the repository at this point in the history
  • Loading branch information
shashidharatd committed Oct 15, 2018
1 parent 052f7e7 commit 96b50dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions registry/txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ func (im *TXTRegistry) Records() ([]*endpoint.Endpoint, error) {
}

for _, ep := range endpoints {
ep.Labels = endpoint.NewLabels()
if labels, ok := labelMap[ep.DNSName]; ok {
for k, v := range labels {
ep.Labels[k] = v
}
} else {
//this indicates that owner could not be identified, as there is no corresponding TXT record
ep.Labels = endpoint.NewLabels()
}
}

Expand Down

0 comments on commit 96b50dd

Please sign in to comment.