Fixed some formating mistakes

Signed-off-by: João Marçal <joao.marcal12@gmail.com>
This commit is contained in:
João Marçal 2019-07-18 11:27:18 +02:00
parent 9f6ebfa06d
commit cb3f8c9ca5

View File

@ -126,27 +126,27 @@ func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) {
} }
illegalTarget := false illegalTarget := false
for _, target := range ep.Targets{ for _, target := range ep.Targets {
if strings.HasSuffix(target, "."){ if strings.HasSuffix(target, ".") {
illegalTarget = true illegalTarget = true
break break
} }
} }
if illegalTarget{ if illegalTarget {
log.Warnf("Endpoint %s with DNSName %s has Target illegal target. The subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com')", dnsEndpoint.ObjectMeta.Name, ep.DNSName) log.Warnf("Endpoint %s with DNSName %s has Target illegal target. The subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com')", dnsEndpoint.ObjectMeta.Name, ep.DNSName)
continue continue
} }
if ep.Labels == nil{ if ep.Labels == nil {
ep.Labels = endpoint.NewLabels() ep.Labels = endpoint.NewLabels()
} }
crdEndpoints = append(crdEndpoints, ep) crdEndpoints = append(crdEndpoints, ep)
} }
cs.setResourceLabel(&dnsEndpoint, crdEndpoints) cs.setResourceLabel(&dnsEndpoint, crdEndpoints)
endpoints = append(endpoints, crdEndpoints...) endpoints = append(endpoints, crdEndpoints...)
if dnsEndpoint.Status.ObservedGeneration == dnsEndpoint.Generation { if dnsEndpoint.Status.ObservedGeneration == dnsEndpoint.Generation {
continue continue
} }