From e98dea02de807eaef2fe174238a36cae23ec227e Mon Sep 17 00:00:00 2001 From: Patrik Date: Sat, 6 Jan 2024 13:02:10 +0100 Subject: [PATCH] scaleway: add cname support (#2075) --- go.mod | 2 +- go.sum | 4 ++-- providers/dns/scaleway/scaleway.go | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 0225f0f7..efe3576b 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2 github.com/sacloud/api-client-go v0.2.8 github.com/sacloud/iaas-api-go v1.11.1 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22 github.com/softlayer/softlayer-go v1.1.2 github.com/stretchr/testify v1.8.4 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.490 diff --git a/go.sum b/go.sum index b9f24d86..487e6bd8 100644 --- a/go.sum +++ b/go.sum @@ -539,8 +539,8 @@ github.com/sacloud/iaas-api-go v1.11.1 h1:2MsFZ4H1uRdRVx2nVXuERWQ3swoFc3XreIV5hJ github.com/sacloud/iaas-api-go v1.11.1/go.mod h1:uBDSa06F/V0OnoR66jGdbH0PVnCJw+NeE9RVbVgMfss= github.com/sacloud/packages-go v0.0.9 h1:GbinkBLC/eirFhHpLjoDW6JV7+95Rnd2d8RWj7Afeks= github.com/sacloud/packages-go v0.0.9/go.mod h1:k+EEUMF2LlncjbNIJNOqLyZ9wjTESPIWIk1OA7x9j2Q= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 h1:1WuWJu7/e8SqK+uQl7lfk/N/oMZTL2NE/TJsNKRNMc4= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22 h1:wJrcTdddKOI8TFxs8cemnhKP2EmKy3yfUKHj3ZdfzYo= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= diff --git a/providers/dns/scaleway/scaleway.go b/providers/dns/scaleway/scaleway.go index 382c5f30..f6f606f3 100644 --- a/providers/dns/scaleway/scaleway.go +++ b/providers/dns/scaleway/scaleway.go @@ -121,13 +121,13 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { Comment: scw.StringPtr("used by lego"), }} - // TODO(ldez) replace domain by FQDN to follow CNAME. req := &scwdomain.UpdateDNSZoneRecordsRequest{ - DNSZone: domain, + DNSZone: info.EffectiveFQDN, Changes: []*scwdomain.RecordChange{{ Add: &scwdomain.RecordChangeAdd{Records: records}, }}, - ReturnAllRecords: scw.BoolPtr(false), + ReturnAllRecords: scw.BoolPtr(false), + DisallowNewZoneCreation: true, } _, err := d.client.UpdateDNSZoneRecords(req) @@ -148,13 +148,13 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { Data: scw.StringPtr(fmt.Sprintf(`%q`, info.Value)), } - // TODO(ldez) replace domain by FQDN to follow CNAME. req := &scwdomain.UpdateDNSZoneRecordsRequest{ - DNSZone: domain, + DNSZone: info.EffectiveFQDN, Changes: []*scwdomain.RecordChange{{ Delete: &scwdomain.RecordChangeDelete{IDFields: recordIdentifier}, }}, - ReturnAllRecords: scw.BoolPtr(false), + ReturnAllRecords: scw.BoolPtr(false), + DisallowNewZoneCreation: true, } _, err := d.client.UpdateDNSZoneRecords(req)