From 2bacebe9008f03ba8dbba32d15424bb0b518c026 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Wed, 26 Feb 2025 15:45:28 +1000 Subject: [PATCH] refactor(dns): remove leading dot from domain when interecting with Uncloud DNS --- internal/dns/client.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/internal/dns/client.go b/internal/dns/client.go index 3f253bab..4549d937 100644 --- a/internal/dns/client.go +++ b/internal/dns/client.go @@ -8,7 +8,6 @@ import ( "io" "log/slog" "net/http" - "strings" ) // The dns package code is based on https://github.com/acorn-io/runtime/blob/main/pkg/dns. @@ -53,18 +52,10 @@ func (c *client) ReserveDomain(endpoint string) (string, string, error) { return "", "", err } - domain := resp.Name - if strings.HasPrefix(domain, ".") { - domain = domain[1:] - } - return domain, resp.Token, nil + return resp.Name, resp.Token, nil } func (c *client) CreateRecords(endpoint, domain, token string, records []RecordRequest) ([]RecordResponse, error) { - // TODO: update Uncloud DNS service to not use a leading dot for domain names. - if !strings.HasPrefix(domain, ".") { - domain = "." + domain - } url := fmt.Sprintf("%s/domains/%s/records", endpoint, domain) var resp []RecordResponse