Skip to content

Commit

Permalink
Merge pull request #1246 from tgross/f-template-config-mapper
Browse files Browse the repository at this point in the history
allow return of TemplateConfigMapping to be comparable
  • Loading branch information
eikenb authored Aug 5, 2019
2 parents cd95ff8 + b5fe848 commit 1532ed9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions manager/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,14 +940,16 @@ func (r *Runner) templateConfigsFor(tmpl *template.Template) []*config.TemplateC

// TemplateConfigMapping returns a mapping between the template ID and the set
// of TemplateConfig represented by the template ID
func (r *Runner) TemplateConfigMapping() map[string][]config.TemplateConfig {
m := make(map[string][]config.TemplateConfig, len(r.ctemplatesMap))
func (r *Runner) TemplateConfigMapping() map[string][]*config.TemplateConfig {
// this method is primarily used to support embedding consul-template
// in other applications (ex. Nomad)
m := make(map[string][]*config.TemplateConfig, len(r.ctemplatesMap))

for id, set := range r.ctemplatesMap {
ctmpls := make([]config.TemplateConfig, len(set))
ctmpls := make([]*config.TemplateConfig, len(set))
m[id] = ctmpls
for i, ctmpl := range set {
ctmpls[i] = *ctmpl
ctmpls[i] = ctmpl
}
}

Expand Down

0 comments on commit 1532ed9

Please sign in to comment.