Skip to content

Commit 2b4c0ee

Browse files
committed
Fix endpoint comparison issue
* Avoid infinite loop of updates
1 parent bd63dc2 commit 2b4c0ee

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

provider/cloudflare/cloudflare.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ func (c *DNSRecordsConfig) GetTags() []string {
110110
if c.Tags == "" {
111111
return nil
112112
}
113-
return strings.Split(c.Tags, ",")
113+
tags := strings.Split(c.Tags, ",")
114+
return tags
114115
}
115116

116117
var recordTypeCustomHostnameSupported = map[string]bool{
@@ -882,6 +883,7 @@ func (p *CloudFlareProvider) newCloudFlareChange(action string, ep *endpoint.End
882883
tags = strings.Split(providerSpecific.Value, ",")
883884
}
884885
}
886+
sort.Strings(tags)
885887

886888
// Free account checks
887889
if tags != nil || len(comment) > freeZoneCommentMaxLength {
@@ -1098,6 +1100,16 @@ func groupByNameAndTypeWithCustomHostnames(records DNSRecordsMap, chs CustomHost
10981100
e = e.WithProviderSpecific(source.CloudflareCustomHostnameKey, strings.Join(customHostnames, ","))
10991101
}
11001102

1103+
if records[0].Comment != "" {
1104+
e = e.WithProviderSpecific(source.CloudflareRecordCommentKey, records[0].Comment)
1105+
}
1106+
1107+
if len(records[0].Tags) > 0 {
1108+
tags := records[0].Tags
1109+
sort.Strings(tags)
1110+
e = e.WithProviderSpecific(source.CloudflareRecordTagsKey, strings.Join(tags, ","))
1111+
}
1112+
11011113
endpoints = append(endpoints, e)
11021114
}
11031115

0 commit comments

Comments
 (0)