Gandi does not support TTLs > 30 days
* Fix
TODO(tlim): Add tests.
* fixup!
@@ -8,6 +8,7 @@ import (
"github.com/StackExchange/dnscontrol/models"
"github.com/StackExchange/dnscontrol/providers"
"github.com/StackExchange/dnscontrol/providers/diff"
+ "github.com/pkg/errors"
"strings"
@@ -77,6 +78,9 @@ func (c *GandiApi) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
log.Printf("WARNING: Gandi does not support ttls < 300. %s will not be set to %d.", rec.NameFQDN, rec.TTL)
rec.TTL = 300
}
+ if rec.TTL > 2592000 {
+ return nil, errors.Errorf("ERROR: Gandi does not support TTLs > 30 days (TTL=%d)", rec.TTL)
+ }
if rec.Type == "TXT" {
rec.Target = "\"" + rec.Target + "\"" // FIXME(tlim): Should do proper quoting.
}
