Do not add extra new lines when creating nebula provisioners

This commit is contained in:
Mariano Cano 2022-01-07 11:24:59 -08:00
parent 0920224816
commit de549adf2d

View file

@ -1,6 +1,7 @@
package authority
import (
"bytes"
"context"
"crypto/x509"
"encoding/json"
@ -713,7 +714,7 @@ func ProvisionerToCertificates(p *linkedca.Provisioner) (provisioner.Interface,
case *linkedca.ProvisionerDetails_Nebula:
var roots []byte
for i, root := range d.Nebula.GetRoots() {
if i > 0 {
if i > 0 && !bytes.HasSuffix(root, []byte{'\n'}) {
roots = append(roots, '\n')
}
roots = append(roots, root...)