Skip to content

Commit

Permalink
Improved handling concurrent pending challenge; more logging (#13)
Browse files Browse the repository at this point in the history
* improved handling for concurrent pending challenge; more logging

* simplified build
  • Loading branch information
MartinWeindel authored Dec 19, 2019
1 parent 068102c commit 4d05618
Showing 2 changed files with 5 additions and 15 deletions.
12 changes: 0 additions & 12 deletions Dockerfile

This file was deleted.

8 changes: 5 additions & 3 deletions pkg/controller/issuer/certificate/reconciler.go
Original file line number Diff line number Diff line change
@@ -139,20 +139,21 @@ func (r *certReconciler) Start() {
}

func (r *certReconciler) Reconcile(logger logger.LogContext, obj resources.Object) reconcile.Status {
logger.Infof("reconciling")
logger.Infof("reconciling certificate")
cert, ok := obj.Data().(*api.Certificate)
if !ok {
return r.failed(logger, obj, api.StateError, fmt.Errorf("casting to Certificate failed"))
}

if !r.classes.IsResponsibleFor(logger, obj) {
logger.Infof("not responsible")
return reconcile.Succeeded(logger)
}

r.support.AddCertificate(logger, cert)

if cert.Spec.SecretRef == nil && r.challengePending(cert) {
return reconcile.Succeeded(logger)
if r.challengePending(cert) {
return reconcile.Recheck(logger, fmt.Errorf("challenge pending for at least one domain of certificate"), 30*time.Second)
}

if result := r.pendingResults.Remove(obj.ObjectName()); result != nil {
@@ -227,6 +228,7 @@ func (r *certReconciler) challengePending(crt *api.Certificate) bool {

func (r *certReconciler) obtainCertificateAndPending(logger logger.LogContext, obj resources.Object, renewSecret *corev1.Secret) reconcile.Status {
cert := obj.Data().(*api.Certificate)
logger.Infof("obtain certificate")

reguser, server, err := r.restoreRegUser(cert)
if err != nil {

0 comments on commit 4d05618

Please sign in to comment.