Skip to content

Commit 1106ad3

Browse files
authored
ns1: fix record creation (#2115)
1 parent fd6047a commit 1106ad3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
env:
1515
GO_VERSION: stable
16-
GOLANGCI_LINT_VERSION: ${{vars.GOLANGCI_LINT_VERSION}}
17-
HUGO_VERSION: ${{vars.HUGO_VERSION}}
16+
GOLANGCI_LINT_VERSION: v1.56.1
17+
HUGO_VERSION: 0.117.0
1818
CGO_ENABLED: 0
1919
LEGO_E2E_TESTS: CI
2020
MEMCACHED_HOSTS: localhost:11211

providers/dns/ns1/ns1.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
9797
if errors.Is(err, rest.ErrRecordMissing) || record == nil {
9898
log.Infof("Create a new record for [zone: %s, fqdn: %s, domain: %s]", zone.Zone, info.EffectiveFQDN, domain)
9999

100-
record = dns.NewRecord(zone.Zone, dns01.UnFqdn(info.EffectiveFQDN), "TXT", nil, nil)
100+
// 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 ...)
101+
// So the `tags` and `blockedTags` parameters should be initialized to empty.
102+
record = dns.NewRecord(zone.Zone, dns01.UnFqdn(info.EffectiveFQDN), "TXT", make(map[string]string), make([]string, 0))
101103
record.TTL = d.config.TTL
102104
record.Answers = []*dns.Answer{{Rdata: []string{info.Value}}}
103105

0 commit comments

Comments
 (0)