From de549adf2d259baf5215006d9b3524f2b885ba4f Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Fri, 7 Jan 2022 11:24:59 -0800 Subject: [PATCH] Do not add extra new lines when creating nebula provisioners --- authority/provisioners.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authority/provisioners.go b/authority/provisioners.go index c7be830e..a98b78a6 100644 --- a/authority/provisioners.go +++ b/authority/provisioners.go @@ -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...)