Skip to content

Commit 635474f

Browse files
committed
Prevent ZoneHasPaidPlan calls unless premium config is detected
1 parent ba3a36c commit 635474f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

provider/cloudflare/cloudflare.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -876,14 +876,15 @@ func (p *CloudFlareProvider) newCloudFlareChange(action string, ep *endpoint.End
876876
tags = strings.Split(providerSpecific.Value, ",")
877877
}
878878
}
879-
// Free account checks
880-
if !p.ZoneHasPaidPlan(ep.DNSName) {
881-
if tags != nil {
879+
880+
// Free account checks https://developers.cloudflare.com/dns/manage-dns-records/reference/record-attributes/#availability
881+
if tags != nil || len(comment) > 100 {
882+
freeAccount := !p.ZoneHasPaidPlan(ep.DNSName)
883+
if freeAccount && tags != nil {
882884
log.Warnf("DNS tags are only available for paid accounts, skipping for %s", ep.DNSName)
883885
tags = nil
884886
}
885-
886-
if len(comment) > 100 {
887+
if freeAccount && len(comment) > 100 {
887888
log.Warnf("DNS record comment is limited to 100 chars for free zones, trimming comment of %s", ep.DNSName)
888889
comment = comment[:99]
889890
}

0 commit comments

Comments
 (0)