Skip to content

Commit

Permalink
ns1: fix record creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Feb 16, 2024
1 parent fd6047a commit 756d0c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion providers/dns/ns1/ns1.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
if errors.Is(err, rest.ErrRecordMissing) || record == nil {
log.Infof("Create a new record for [zone: %s, fqdn: %s, domain: %s]", zone.Zone, info.EffectiveFQDN, domain)

record = dns.NewRecord(zone.Zone, dns01.UnFqdn(info.EffectiveFQDN), "TXT", nil, nil)
// Work through a bug in the NS1 API library that causes 400 Input validation failed (Value None for field '<obj>.filters' is not of type ...)
// So the `tags` and `blockedTags` parameters should be initialized to empty.
record = dns.NewRecord(zone.Zone, dns01.UnFqdn(info.EffectiveFQDN), "TXT", make(map[string]string), make([]string, 0))
record.TTL = d.config.TTL
record.Answers = []*dns.Answer{{Rdata: []string{info.Value}}}

Expand Down

0 comments on commit 756d0c3

Please sign in to comment.