dns providers: fix errors. (#642)
* fix: gloud errors. * fix: azure errors. * fix: iij errors.
This commit is contained in:
parent
039f5cf785
commit
ab0048544f
3 changed files with 20 additions and 5 deletions
|
@ -127,7 +127,10 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = rsc.CreateOrUpdate(ctx, d.config.ResourceGroup, zone, relative, dns.TXT, rec, "", "")
|
_, err = rsc.CreateOrUpdate(ctx, d.config.ResourceGroup, zone, relative, dns.TXT, rec, "", "")
|
||||||
return fmt.Errorf("azure: %v", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("azure: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanUp removes the TXT record matching the specified parameters
|
// CleanUp removes the TXT record matching the specified parameters
|
||||||
|
@ -150,7 +153,10 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
rsc.Authorizer = autorest.NewBearerAuthorizer(spt)
|
rsc.Authorizer = autorest.NewBearerAuthorizer(spt)
|
||||||
|
|
||||||
_, err = rsc.Delete(ctx, d.config.ResourceGroup, zone, relative, dns.TXT, "")
|
_, err = rsc.Delete(ctx, d.config.ResourceGroup, zone, relative, dns.TXT, "")
|
||||||
return fmt.Errorf("azure: %v", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("azure: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks that azure has a zone for this domain name.
|
// Checks that azure has a zone for this domain name.
|
||||||
|
|
|
@ -188,7 +188,10 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = d.client.Changes.Create(d.config.Project, zone, &dns.Change{Deletions: records}).Do()
|
_, err = d.client.Changes.Create(d.config.Project, zone, &dns.Change{Deletions: records}).Do()
|
||||||
return fmt.Errorf("googlecloud: %v", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("googlecloud: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timeout customizes the timeout values used by the ACME package for checking
|
// Timeout customizes the timeout values used by the ACME package for checking
|
||||||
|
|
|
@ -76,7 +76,10 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||||
_, value, _ := acme.DNS01Record(domain, keyAuth)
|
_, value, _ := acme.DNS01Record(domain, keyAuth)
|
||||||
|
|
||||||
err := d.addTxtRecord(domain, value)
|
err := d.addTxtRecord(domain, value)
|
||||||
return fmt.Errorf("iij: %v", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("iij: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanUp removes the TXT record matching the specified parameters
|
// CleanUp removes the TXT record matching the specified parameters
|
||||||
|
@ -84,7 +87,10 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
_, value, _ := acme.DNS01Record(domain, keyAuth)
|
_, value, _ := acme.DNS01Record(domain, keyAuth)
|
||||||
|
|
||||||
err := d.deleteTxtRecord(domain, value)
|
err := d.deleteTxtRecord(domain, value)
|
||||||
return fmt.Errorf("iij: %v", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("iij: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DNSProvider) addTxtRecord(domain, value string) error {
|
func (d *DNSProvider) addTxtRecord(domain, value string) error {
|
||||||
|
|
Loading…
Reference in a new issue