aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceK8sExternalProvider/src
diff options
context:
space:
mode:
Diffstat (limited to 'certServiceK8sExternalProvider/src')
-rw-r--r--certServiceK8sExternalProvider/src/api/groupversion_info.go2
-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
-rw-r--r--certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go4
5 files changed, 10 insertions, 5 deletions
diff --git a/certServiceK8sExternalProvider/src/api/groupversion_info.go b/certServiceK8sExternalProvider/src/api/groupversion_info.go
index e5cdea12..0a64b25e 100644
--- a/certServiceK8sExternalProvider/src/api/groupversion_info.go
+++ b/certServiceK8sExternalProvider/src/api/groupversion_info.go
@@ -32,7 +32,7 @@ import (
var (
// GroupVersion is group version used to register these objects
- GroupVersion = schema.GroupVersion{Group: "certmanager.onap.org", Version: "v1beta1"}
+ GroupVersion = schema.GroupVersion{Group: "certmanager.onap.org", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
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{}) {
diff --git a/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go b/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
index b20e0395..262e708b 100644
--- a/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
+++ b/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
@@ -32,7 +32,7 @@ import (
"encoding/base64"
"encoding/pem"
"fmt"
- certmanager "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2"
+ certmanager "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
"k8s.io/apimachinery/pkg/types"
"onap.org/oom-certservice/k8s-external-provider/src/api"
ctrl "sigs.k8s.io/controller-runtime"
@@ -80,7 +80,7 @@ func (ca *CertServiceCA) Sign(ctx context.Context, certificateRequest *certmanag
key, _ := base64.RawStdEncoding.DecodeString(string(ca.key))
log.Info("CA: ", "name", ca.name, "url", ca.url, "key", key)
- crPEM := certificateRequest.Spec.CSRPEM
+ crPEM := certificateRequest.Spec.Request
csrBase64 := crPEM
log.Info("Csr PEM: ", "bytes", csrBase64)