aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go
diff options
context:
space:
mode:
authorJan Malkiewicz <jan.malkiewicz@nokia.com>2020-10-23 09:46:13 +0200
committerJan Malkiewicz <jan.malkiewicz@nokia.com>2020-10-26 08:57:00 +0100
commita7bb3d59e71f7f7980f8b7db400df94cabd92c0a (patch)
tree75891dbe1512a6d035e054f4b88104f26778beea /certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go
parentee23e5f54f96807b1f1fff0b45238a247d3dd8e0 (diff)
[OOM-K8S-CERT-EXTERNAL-PROVIDER] Add health check of CMPv2 provisioner (cert-service-api)
Issue-ID: OOM-2559 Signed-off-by: Jan Malkiewicz <jan.malkiewicz@nokia.com> Change-Id: I81d4dcfcb10f71182ea667770bafb9556817b793
Diffstat (limited to 'certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go')
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go b/certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go
index 1b4e5312..c6e0e1da 100644
--- a/certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go
+++ b/certServiceK8sExternalProvider/src/cmpv2controller/cmpv2_issuer_controller.go
@@ -83,7 +83,7 @@ func (controller *CMPv2IssuerController) Reconcile(req ctrl.Request) (ctrl.Resul
return ctrl.Result{}, err
}
- // 4. Create CMPv2 provisioner and store the instance for further use
+ // 4. Create CMPv2 provisioner
provisioner, err := provisioners.CreateProvisioner(issuer, secret)
if err != nil {
log.Error(err, "failed to initialize provisioner")
@@ -91,9 +91,14 @@ func (controller *CMPv2IssuerController) Reconcile(req ctrl.Request) (ctrl.Resul
handleErrorProvisionerInitialization(ctx, log, err, statusUpdater)
return ctrl.Result{}, err
}
+
+ // 5. Check health of the provisioner and store the instance for further use
+ if err := provisioner.CheckHealth(); err != nil {
+ return ctrl.Result{}, err
+ }
provisioners.Store(req.NamespacedName, provisioner)
- // 5. Update the status of CMPv2Issuer to 'Validated'
+ // 6. Update the status of CMPv2Issuer to 'Validated'
if err := updateCMPv2IssuerStatusToVerified(statusUpdater, ctx, log); err != nil {
handleErrorUpdatingCMPv2IssuerStatus(log, err)
return ctrl.Result{}, err