Skip to content

Commit

Permalink
scaleway: add cname support (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4d1 committed Jan 6, 2024
1 parent 6da9220 commit e98dea0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -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=
Expand Down
12 changes: 6 additions & 6 deletions providers/dns/scaleway/scaleway.go
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e98dea0

Please sign in to comment.