Skip to content

Commit

Permalink
provisionerOptionsToLinkedCA missing template and templateData (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
dopey authored Aug 30, 2023
1 parent 116ff8e commit e22166c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion authority/provisioners.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +754,17 @@ func provisionerOptionsToLinkedca(p *provisioner.Options) (*linkedca.Template, *
}

if p.X509.Template != "" {
x509Template.Template = []byte(p.SSH.Template)
x509Template.Template = []byte(p.X509.Template)
} else if p.X509.TemplateFile != "" {
filename := step.Abs(p.X509.TemplateFile)
if x509Template.Template, err = os.ReadFile(filename); err != nil {
return nil, nil, nil, errors.Wrap(err, "error reading x509 template")
}
}

if p.X509.TemplateData != nil {
x509Template.Data = p.X509.TemplateData
}
}

if p.SSH != nil && p.SSH.HasTemplate() {
Expand All @@ -777,6 +781,10 @@ func provisionerOptionsToLinkedca(p *provisioner.Options) (*linkedca.Template, *
return nil, nil, nil, errors.Wrap(err, "error reading ssh template")
}
}

if p.SSH.TemplateData != nil {
sshTemplate.Data = p.SSH.TemplateData
}
}

var webhooks []*linkedca.Webhook
Expand Down

0 comments on commit e22166c

Please sign in to comment.