Skip to content

Commit

Permalink
feat: annotate newly created DNS records (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia authored Jan 16, 2023
1 parent 4ace8eb commit 09bbaf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/api/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ func (h *CloudflareHandle) CreateRecord(ctx context.Context, ppfmt pp.PP,
Content: ip.String(),
TTL: ttl.Int(),
Proxied: &proxied,
Comment: "Created by cloudflare-ddns",
}

res, err := h.cf.CreateDNSRecord(ctx, cloudflare.ZoneIdentifier(zone), params)
Expand Down
1 change: 1 addition & 0 deletions internal/api/cloudflare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ func TestCreateRecordValid(t *testing.T) {
require.Equal(t, "::1", record.Content)
require.Equal(t, 100, record.TTL)
require.Equal(t, false, *record.Proxied)
require.Equal(t, "Created by cloudflare-ddns", record.Comment)
record.ID = "record1"

w.Header().Set("content-type", "application/json")
Expand Down

0 comments on commit 09bbaf4

Please sign in to comment.