forked from TrueCloudLab/lego
fix: TXT records clean up for Vscale DNS provider (#798)
This commit is contained in:
parent
938ba435d6
commit
d891600a89
1 changed files with 2 additions and 1 deletions
|
@ -128,6 +128,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||||
// CleanUp removes a TXT record used for DNS-01 challenge.
|
// CleanUp removes a TXT record used for DNS-01 challenge.
|
||||||
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
fqdn, _ := dns01.GetRecord(domain, keyAuth)
|
fqdn, _ := dns01.GetRecord(domain, keyAuth)
|
||||||
|
recordName := dns01.UnFqdn(fqdn)
|
||||||
|
|
||||||
domainObj, err := d.client.GetDomainByName(domain)
|
domainObj, err := d.client.GetDomainByName(domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -142,7 +143,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
// Delete records with specific FQDN
|
// Delete records with specific FQDN
|
||||||
var lastErr error
|
var lastErr error
|
||||||
for _, record := range records {
|
for _, record := range records {
|
||||||
if record.Name == fqdn {
|
if record.Name == recordName {
|
||||||
err = d.client.DeleteRecord(domainObj.ID, record.ID)
|
err = d.client.DeleteRecord(domainObj.ID, record.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lastErr = fmt.Errorf("vscale: %v", err)
|
lastErr = fmt.Errorf("vscale: %v", err)
|
||||||
|
|
Loading…
Reference in a new issue