mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
review suggestions
This commit is contained in:
parent
f659f40697
commit
799ec6d2c9
@ -707,6 +707,9 @@ func groupByNameAndTypeWithCh(records []cloudflare.DNSRecord, chs []cloudflare.C
|
||||
|
||||
// create single endpoint with all the targets for each name/type
|
||||
for _, records := range groups {
|
||||
if len(records) == 0 {
|
||||
return endpoints
|
||||
}
|
||||
targets := make([]string, len(records))
|
||||
for i, record := range records {
|
||||
targets[i] = record.Content
|
||||
@ -716,7 +719,11 @@ func groupByNameAndTypeWithCh(records []cloudflare.DNSRecord, chs []cloudflare.C
|
||||
records[0].Type,
|
||||
endpoint.TTL(records[0].TTL),
|
||||
targets...)
|
||||
ep.WithProviderSpecific(source.CloudflareProxiedKey, strconv.FormatBool(*records[0].Proxied))
|
||||
proxied := false
|
||||
if records[0].Proxied != nil {
|
||||
proxied = *records[0].Proxied
|
||||
}
|
||||
ep.WithProviderSpecific(source.CloudflareProxiedKey, strconv.FormatBool(proxied))
|
||||
if _, ok := customOriginServers[records[0].Name]; ok {
|
||||
ep.WithProviderSpecific(source.CloudflareCustomHostnameKey, customOriginServers[records[0].Name])
|
||||
}
|
||||
|
@ -190,15 +190,13 @@ func getAliasFromAnnotations(annotations map[string]string) bool {
|
||||
func getProviderSpecificAnnotations(annotations map[string]string) (endpoint.ProviderSpecific, string) {
|
||||
providerSpecificAnnotations := endpoint.ProviderSpecific{}
|
||||
|
||||
v, exists := annotations[CloudflareProxiedKey]
|
||||
if exists {
|
||||
if v, exists := annotations[CloudflareProxiedKey]; exists {
|
||||
providerSpecificAnnotations = append(providerSpecificAnnotations, endpoint.ProviderSpecificProperty{
|
||||
Name: CloudflareProxiedKey,
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
v, exists = annotations[CloudflareCustomHostnameKey]
|
||||
if exists {
|
||||
if v, exists := annotations[CloudflareCustomHostnameKey]; exists {
|
||||
providerSpecificAnnotations = append(providerSpecificAnnotations, endpoint.ProviderSpecificProperty{
|
||||
Name: CloudflareCustomHostnameKey,
|
||||
Value: v,
|
||||
|
Loading…
Reference in New Issue
Block a user