Merge pull request #739 from shashidharatd/nilmap

Fix nil map access of endpoint labels
This commit is contained in:
k8s-ci-robot 2018-10-15 05:07:23 -07:00 committed by GitHub
commit db13a3d5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
}
}