catalog/certificate: reuse variable for CN
@@ -12,7 +12,7 @@ func (mc *MeshCatalog) GetCertificateForService(nsService service.NamespacedServ
cert, err := mc.certManager.GetCertificate(cn)
if err != nil {
// Certificate was not found in CertManager's cache, issue one
- newCert, err := mc.certManager.IssueCertificate(nsService.GetCommonName(), nil)
+ newCert, err := mc.certManager.IssueCertificate(cn, nil)
if err != nil {
log.Error().Err(err).Msgf("Error issuing a new certificate for service:%s, CN: %s", nsService, cn)
return nil, err
