Merge pull request #321 from twz123/fix-log-warning

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Log potential errors while waiting for DNS record propagation

**What this PR does / why we need it**:
This helps debugging, e.g. if there are network problems.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
This commit is contained in:
jetstack-ci-bot 2018-02-21 13:39:28 +00:00 committed by GitHub
commit 058a259f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,15 +72,19 @@ func (s *Solver) Wait(ctx context.Context, crt *v1alpha1.Certificate, domain, to
}()
return out
}():
if r.bool {
if r.error != nil {
glog.Warningf("Failed to check for DNS propagation of %q: %v", domain, r.error)
} else if r.bool {
// TODO: move this to somewhere else
// TODO: make this wait for whatever the record *was*, not is now
glog.V(4).Infof("Waiting DNS record TTL (%ds) to allow propagation for propagation of DNS record for domain %q", ttl, fqdn)
time.Sleep(time.Second * time.Duration(ttl))
glog.V(4).Infof("ACME DNS01 validation record propagated for %q", fqdn)
return nil
} else {
glog.V(4).Infof("DNS record for %q not yet propagated", domain)
}
glog.V(4).Infof("DNS record for %q not yet propagated", domain)
time.Sleep(interval)
case <-ctx.Done():
return ctx.Err()