diff options
author | 2021-07-13 16:47:08 +0200 | |
---|---|---|
committer | 2021-07-15 12:15:13 +0200 | |
commit | d63a4674317497fd6700c52c705649ce85ac3725 (patch) | |
tree | cd649e56e8eef1ba06ec89c164bbe8739dd0cd4b /certServiceK8sExternalProvider/src/cmpv2controller | |
parent | 78b60d22b8779d1fbf3e27287b9774862f71404b (diff) |
[OOM-K8S-CERT-EXTERNAL-PROVIDER] Add send update request functionality
Issue-ID: OOM-2753
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I0637ded5c870cc66c7dc27dff269dab0f7d9015b
Diffstat (limited to 'certServiceK8sExternalProvider/src/cmpv2controller')
-rw-r--r-- | certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go b/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go index 1032ee00..9d266854 100644 --- a/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go +++ b/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go @@ -3,7 +3,7 @@ * oom-certservice-k8s-external-provider * ================================================================================ * Copyright 2019 The cert-manager authors. - * Modifications copyright (C) 2020-2021 Nokia. All rights reserved. + * Copyright (C) 2020-2021 Nokia. All rights reserved. * ================================================================================ * This source code was copied from the following git repository: * https://github.com/smallstep/step-issuer @@ -43,6 +43,7 @@ import ( "onap.org/oom-certservice/k8s-external-provider/src/cmpv2controller/util" provisioners "onap.org/oom-certservice/k8s-external-provider/src/cmpv2provisioner" "onap.org/oom-certservice/k8s-external-provider/src/leveledlogger" + "onap.org/oom-certservice/k8s-external-provider/src/model" x509utils "onap.org/oom-certservice/k8s-external-provider/src/x509" ) @@ -142,12 +143,18 @@ func (controller *CertificateRequestController) Reconcile(k8sRequest ctrl.Reques isUpdateRevision, oldCertificate, oldPrivateKey := util.CheckIfCertificateUpdateAndRetrieveOldCertificateAndPk( controller.Client, certificateRequest, ctx) if isUpdateRevision { - log.Debug("Certificate will be updated.", "old-certificate", oldCertificate, - "old-private-key", oldPrivateKey) //TODO: remove private key from logger + log.Info("Update revision detected") + } + signCertificateModel := model.SignCertificateModel{ + CertificateRequest: certificateRequest, + PrivateKeyBytes: privateKeyBytes, + IsUpdateRevision: isUpdateRevision, + OldCertificate: oldCertificate, + OldPrivateKey: oldPrivateKey, } // 11. Sign CertificateRequest - signedPEM, trustedCAs, err := provisioner.Sign(ctx, certificateRequest, privateKeyBytes) + signedPEM, trustedCAs, err := provisioner.Sign(ctx, signCertificateModel) if err != nil { controller.handleErrorFailedToSignCertificate(certUpdater, log, err) return ctrl.Result{}, nil |