Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 31, 2024
1 parent ce9fd5f commit 4213009
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions providers/dns/exoscale/exoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,18 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return err
}

if recordID != "" {
op, err := d.client.DeleteDNSDomainRecord(ctx, zone.ID, recordID)
if err != nil {
return fmt.Errorf("exoscale: error while deleting DNS record: %w", err)
}
if recordID == "" {
return nil
}

_, err = d.client.Wait(ctx, op, egoscale.OperationStateSuccess)
if err != nil {
return fmt.Errorf("exoscale: error while creating DNS record: %w", err)
}
op, err := d.client.DeleteDNSDomainRecord(ctx, zone.ID, recordID)
if err != nil {
return fmt.Errorf("exoscale: error while deleting DNS record: %w", err)
}

_, err = d.client.Wait(ctx, op, egoscale.OperationStateSuccess)
if err != nil {
return fmt.Errorf("exoscale: error while creating DNS record: %w", err)
}

return nil
Expand Down

0 comments on commit 4213009

Please sign in to comment.