Skip to content

Commit

Permalink
Adds CABundle output for file
Browse files Browse the repository at this point in the history
  • Loading branch information
tlm committed Jan 8, 2019
1 parent 672acb6 commit f2b3caf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dest/config/file_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ type File struct {
CAFileMode string
CAFileGid string
CAFileUid string
CABundleFile string
CABundleFileMode string
CABundleFileGid string
CABundleFileUid string
CertFile string
CertFileMode string
CertFileGid string
Expand Down Expand Up @@ -40,6 +44,15 @@ func FileMapper(v interface{}) (dest.Dest, error) {
}
fileDests = append(fileDests, dest.NewTemplateFile(dest.CAFile, caFile))
}
if conf.CABundleFile != "" {
caBundleFile, err := DestFileBuilder(conf.CABundleFile,
conf.CABundleFileMode, conf.CABundleFileGid, conf.CABundleFileUid)
if err != nil {
return nil, errors.Wrap(err, "caBundleFile")
}
fileDests = append(fileDests, dest.NewTemplateFile(dest.CABundleFile,
caBundleFile))
}
if conf.CertFile != "" {
certFile, err := DestFileBuilder(conf.CertFile, conf.CertFileMode,
conf.CertFileGid, conf.CertFileUid)
Expand Down
1 change: 1 addition & 0 deletions dest/file_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dest
type FileDestType string

var (
CABundleFile FileDestType = "{{ .CABundle }}"
CAFile FileDestType = "{{ .CA }}"
CertificateFile FileDestType = "{{ .Certificate }}"
CertificateBundleFile FileDestType = "{{ .Certificate }}\n{{ .CABundle }}"
Expand Down

0 comments on commit f2b3caf

Please sign in to comment.