1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

CLOUDNS: Fetch permitted TTL values from API #1078 (#1102)

The TTL values permitted may be different for each account and for each domain. Therefore we perform this query once per domain.

* Fetch ClouDNS allowed TTL values from API (Fix #1078)
* Add get available TTL values comment
This commit is contained in:
2021-03-22 22:47:29 +09:00
committed by GitHub
parent 8249f33913
commit 4eb6fdface
2 changed files with 20 additions and 17 deletions

View File

@@ -94,8 +94,10 @@ func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
// Normalize
models.PostProcessRecords(existingRecords)
// ClouDNS doesn't allow selecting an arbitrary TTL, only a set of predefined values https://asia.cloudns.net/wiki/article/188/
// We need to make sure we don't change it every time if it is as close as it's going to get
// Get a list of available TTL values.
// The TTL list needs to be obtained for each domain, so get it first here.
c.fetchAvailableTTLValues(dc.Name)
// ClouDNS can only be specified from a specific TTL list, so change the TTL in advance.
for _, record := range dc.Records {
record.TTL = fixTTL(record.TTL)
}