aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceK8sExternalProvider/src/certservice-controller
diff options
context:
space:
mode:
Diffstat (limited to 'certServiceK8sExternalProvider/src/certservice-controller')
-rw-r--r--certServiceK8sExternalProvider/src/certservice-controller/certificaterequest_reconciler.go2
-rw-r--r--certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_reconciler.go3
-rw-r--r--certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_status_reconciler.go4
3 files changed, 7 insertions, 2 deletions
diff --git a/certServiceK8sExternalProvider/src/certservice-controller/certificaterequest_reconciler.go b/certServiceK8sExternalProvider/src/certservice-controller/certificaterequest_reconciler.go
index 92e77960..b744676e 100644
--- a/certServiceK8sExternalProvider/src/certservice-controller/certificaterequest_reconciler.go
+++ b/certServiceK8sExternalProvider/src/certservice-controller/certificaterequest_reconciler.go
@@ -33,7 +33,7 @@ import (
"github.com/go-logr/logr"
apiutil "github.com/jetstack/cert-manager/pkg/api/util"
- cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2"
+ cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"
core "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
diff --git a/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_reconciler.go b/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_reconciler.go
index b22abcd4..b826e2dd 100644
--- a/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_reconciler.go
+++ b/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_reconciler.go
@@ -59,6 +59,7 @@ func (reconciler *CertServiceIssuerReconciler) Reconcile(req ctrl.Request) (ctrl
log.Error(err, "failed to retrieve CertServiceIssuer resource")
return ctrl.Result{}, client.IgnoreNotFound(err)
}
+ log.Info("Issuer loaded: ", "issuer", issuer)
statusReconciler := newStatusReconciler(reconciler, issuer, log)
if err := validateCertServiceIssuerSpec(issuer.Spec); err != nil {
@@ -66,6 +67,7 @@ func (reconciler *CertServiceIssuerReconciler) Reconcile(req ctrl.Request) (ctrl
statusReconciler.UpdateNoError(ctx, api.ConditionFalse, "Validation", "Failed to validate resource: %v", err)
return ctrl.Result{}, err
}
+ log.Info("Issuer validated. ")
// Fetch the provisioner password
var secret core.Secret
@@ -99,6 +101,7 @@ func (reconciler *CertServiceIssuerReconciler) Reconcile(req ctrl.Request) (ctrl
}
provisioners.Store(req.NamespacedName, provisioner)
+ log.Info( "CertServiceIssuer verified. Updating status to Verified...")
return ctrl.Result{}, statusReconciler.Update(ctx, api.ConditionTrue, "Verified", "CertServiceIssuer verified and ready to sign certificates")
}
diff --git a/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_status_reconciler.go b/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_status_reconciler.go
index 6dd8baea..f2c0452e 100644
--- a/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_status_reconciler.go
+++ b/certServiceK8sExternalProvider/src/certservice-controller/certservice_issuer_status_reconciler.go
@@ -57,9 +57,11 @@ func (reconciler *certServiceIssuerStatusReconciler) Update(ctx context.Context,
if status == api.ConditionFalse {
eventType = core.EventTypeWarning
}
+ reconciler.logger.Info("Firing event: ", "issuer", reconciler.issuer, "eventtype", eventType, "reason", reason, "message", completeMessage)
reconciler.Recorder.Event(reconciler.issuer, eventType, reason, completeMessage)
- return reconciler.Client.Status().Update(ctx, reconciler.issuer)
+ reconciler.logger.Info("Updating issuer... ")
+ return reconciler.Client.Update(ctx, reconciler.issuer)
}
func (reconciler *certServiceIssuerStatusReconciler) UpdateNoError(ctx context.Context, status api.ConditionStatus, reason, message string, args ...interface{}) {