Move block outside of parent if/else

This commit is contained in:
Diana Tuck 2025-01-13 12:37:25 -08:00
parent c3225c7cf1
commit fe420f43e5

View File

@ -227,12 +227,14 @@ func (sc *serviceSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, e
mergedEndpoints[lastMergedEndpoint].SetIdentifier == endpoints[i].SetIdentifier &&
mergedEndpoints[lastMergedEndpoint].RecordTTL == endpoints[i].RecordTTL {
mergedEndpoints[lastMergedEndpoint].Targets = append(mergedEndpoints[lastMergedEndpoint].Targets, endpoints[i].Targets[0])
} else if mergedEndpoints[lastMergedEndpoint].DNSName == endpoints[i].DNSName &&
} else {
mergedEndpoints = append(mergedEndpoints, endpoints[i])
}
if mergedEndpoints[lastMergedEndpoint].DNSName == endpoints[i].DNSName &&
mergedEndpoints[lastMergedEndpoint].RecordType == endpoints[i].RecordType &&
mergedEndpoints[lastMergedEndpoint].RecordType == endpoint.RecordTypeCNAME {
log.Debugf("CNAME %s with multiple targets found", endpoints[i].DNSName)
} else {
mergedEndpoints = append(mergedEndpoints, endpoints[i])
}
}
endpoints = mergedEndpoints