forked from TrueCloudLab/lego
Fix a couple of lint and fmt issues.
This commit is contained in:
parent
44d92633c6
commit
74c6bbee86
4 changed files with 9 additions and 10 deletions
|
@ -109,7 +109,7 @@ func (c *DNSProvider) getHostedZoneID(fqdn string) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := c.makeRequest("GET", "/zones?name=" + acme.UnFqdn(authZone), nil)
|
result, err := c.makeRequest("GET", "/zones?name="+acme.UnFqdn(authZone), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||||
authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver)
|
authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err)
|
return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
authZone = acme.UnFqdn(authZone)
|
authZone = acme.UnFqdn(authZone)
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver)
|
authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err)
|
return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
authZone = acme.UnFqdn(authZone)
|
authZone = acme.UnFqdn(authZone)
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ func (c *DNSProvider) getHostedZone(domain string) (string, string, error) {
|
||||||
return "", "", fmt.Errorf("DNSimple API call failed: %v", err)
|
return "", "", fmt.Errorf("DNSimple API call failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
authZone, err := acme.FindZoneByFqdn(domain, acme.RecursiveNameserver)
|
authZone, err := acme.FindZoneByFqdn(domain, acme.RecursiveNameserver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
|
|
|
@ -106,11 +106,11 @@ func (r *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
statusId := resp.ChangeInfo.Id
|
statusID := resp.ChangeInfo.Id
|
||||||
|
|
||||||
return acme.WaitFor(120*time.Second, 4*time.Second, func() (bool, error) {
|
return acme.WaitFor(120*time.Second, 4*time.Second, func() (bool, error) {
|
||||||
reqParams := &route53.GetChangeInput{
|
reqParams := &route53.GetChangeInput{
|
||||||
Id: statusId,
|
Id: statusID,
|
||||||
}
|
}
|
||||||
resp, err := r.client.GetChange(reqParams)
|
resp, err := r.client.GetChange(reqParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -144,12 +144,12 @@ func (r *DNSProvider) getHostedZoneID(fqdn string) (string, error) {
|
||||||
return "", fmt.Errorf("Zone %s not found in Route53 for domain %s", authZone, fqdn)
|
return "", fmt.Errorf("Zone %s not found in Route53 for domain %s", authZone, fqdn)
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneId := *resp.HostedZones[0].Id
|
zoneID := *resp.HostedZones[0].Id
|
||||||
if strings.HasPrefix(zoneId, "/hostedzone/") {
|
if strings.HasPrefix(zoneID, "/hostedzone/") {
|
||||||
zoneId = strings.TrimPrefix(zoneId, "/hostedzone/")
|
zoneID = strings.TrimPrefix(zoneID, "/hostedzone/")
|
||||||
}
|
}
|
||||||
|
|
||||||
return zoneId, nil
|
return zoneID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTXTRecordSet(fqdn, value string, ttl int) *route53.ResourceRecordSet {
|
func newTXTRecordSet(fqdn, value string, ttl int) *route53.ResourceRecordSet {
|
||||||
|
|
Loading…
Reference in a new issue