fix: TXT records clean up for Vscale DNS provider (#798)

This commit is contained in:
Daniil Rutskiy 2019-02-14 15:35:49 +01:00 committed by Ludovic Fernandez
parent 938ba435d6
commit d891600a89

View file

@ -128,6 +128,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
// CleanUp removes a TXT record used for DNS-01 challenge.
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
fqdn, _ := dns01.GetRecord(domain, keyAuth)
recordName := dns01.UnFqdn(fqdn)
domainObj, err := d.client.GetDomainByName(domain)
if err != nil {
@ -142,7 +143,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
// Delete records with specific FQDN
var lastErr error
for _, record := range records {
if record.Name == fqdn {
if record.Name == recordName {
err = d.client.DeleteRecord(domainObj.ID, record.ID)
if err != nil {
lastErr = fmt.Errorf("vscale: %v", err)