Skip to content

Commit

Permalink
Merge pull request #166 from litong01/master
Browse files Browse the repository at this point in the history
Fixed #165: Fix CA cert decoding
  • Loading branch information
yeasy authored Jul 9, 2020
2 parents d0501de + 3d6b428 commit 1f445cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/agent/fabric-operator/pkg/controller/ca/ca_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ca

import (
"context"
"encoding/base64"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -234,10 +235,10 @@ func (r *ReconcileCA) newSecretForCR(cr *fabricv1alpha1.CA, request reconcile.Re
secret.Namespace = request.Namespace
secret.Data = make(map[string][]byte)
if cr.Spec.Certs != nil {
secret.Data["cert"] = []byte(cr.Spec.Certs.Cert)
secret.Data["key"] = []byte(cr.Spec.Certs.Key)
secret.Data["tlsCert"] = []byte(cr.Spec.Certs.TLSCert)
secret.Data["tlsKey"] = []byte(cr.Spec.Certs.TLSKey)
secret.Data["cert"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.Cert)
secret.Data["key"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.Key)
secret.Data["tlsCert"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.TLSCert)
secret.Data["tlsKey"], _ = base64.StdEncoding.DecodeString(cr.Spec.Certs.TLSKey)
}
controllerutil.SetControllerReference(cr, secret, r.scheme)
}
Expand Down

0 comments on commit 1f445cf

Please sign in to comment.