From 09bbaf4bcb8be0fd0865e7f5f998e53f6dcb0741 Mon Sep 17 00:00:00 2001 From: favonia Date: Mon, 16 Jan 2023 06:30:37 -0600 Subject: [PATCH] feat: annotate newly created DNS records (#366) --- internal/api/cloudflare.go | 1 + internal/api/cloudflare_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/api/cloudflare.go b/internal/api/cloudflare.go index 0b4e8c73..66171484 100644 --- a/internal/api/cloudflare.go +++ b/internal/api/cloudflare.go @@ -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) diff --git a/internal/api/cloudflare_test.go b/internal/api/cloudflare_test.go index 8a24a06d..a91b8c26 100644 --- a/internal/api/cloudflare_test.go +++ b/internal/api/cloudflare_test.go @@ -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")