aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2020-10-13 09:08:07 +0200
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2020-10-13 09:10:11 +0200
commit9e42e7b6b524034035e94221098d1374f34c5165 (patch)
tree5a68a7a8321b85e2bb2fe14094b0999b7efdbb28 /certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
parentc8631390d51ad051dbca5baee6e4de56897dc18b (diff)
[OOM-K8S-CERT-EXTERNAL-PROVIDER] Rename variables to readable.
Issue-ID: OOM-2559 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: I1da11dcc12e97f6997a409106e90f6000a6102d0
Diffstat (limited to 'certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go')
-rw-r--r--certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go b/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
index 627c2d42..b20e0395 100644
--- a/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
+++ b/certServiceK8sExternalProvider/src/certservice-provisioner/certservice-provisioner.go
@@ -47,11 +47,11 @@ type CertServiceCA struct {
key []byte
}
-func New(iss *api.CertServiceIssuer, key []byte) (*CertServiceCA, error) {
+func New(certServiceIssuer *api.CertServiceIssuer, key []byte) (*CertServiceCA, error) {
ca := CertServiceCA{}
- ca.name = iss.Name
- ca.url = iss.Spec.URL
+ ca.name = certServiceIssuer.Name
+ ca.url = certServiceIssuer.Spec.URL
ca.key = key
log := ctrl.Log.WithName("certservice-provisioner")
@@ -61,26 +61,26 @@ func New(iss *api.CertServiceIssuer, key []byte) (*CertServiceCA, error) {
}
func Load(namespacedName types.NamespacedName) (*CertServiceCA, bool) {
- v, ok := collection.Load(namespacedName)
+ provisioner, ok := collection.Load(namespacedName)
if !ok {
return nil, ok
}
- p, ok := v.(*CertServiceCA)
- return p, ok
+ certServiceCAprovisioner, ok := provisioner.(*CertServiceCA)
+ return certServiceCAprovisioner, ok
}
func Store(namespacedName types.NamespacedName, provisioner *CertServiceCA) {
collection.Store(namespacedName, provisioner)
}
-func (ca *CertServiceCA) Sign(ctx context.Context, cr *certmanager.CertificateRequest) ([]byte, []byte, error) {
+func (ca *CertServiceCA) Sign(ctx context.Context, certificateRequest *certmanager.CertificateRequest) ([]byte, []byte, error) {
log := ctrl.Log.WithName("certservice-provisioner")
- log.Info("Signing certificate: ", "cert-name", cr.Name)
+ log.Info("Signing certificate: ", "cert-name", certificateRequest.Name)
key, _ := base64.RawStdEncoding.DecodeString(string(ca.key))
log.Info("CA: ", "name", ca.name, "url", ca.url, "key", key)
- crPEM := cr.Spec.CSRPEM
+ crPEM := certificateRequest.Spec.CSRPEM
csrBase64 := crPEM
log.Info("Csr PEM: ", "bytes", csrBase64)
@@ -104,7 +104,7 @@ func (ca *CertServiceCA) Sign(ctx context.Context, cr *certmanager.CertificateRe
signedPEM := encodedPEM
trustedCA := encodedPEM
- log.Info("Successfully signed: ", "cert-name", cr.Name)
+ log.Info("Successfully signed: ", "cert-name", certificateRequest.Name)
log.Info("Signed cert PEM: ", "bytes", signedPEM)
log.Info("Trusted CA PEM: ", "bytes", trustedCA)