Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow return of TemplateConfigMapping to be comparable #1246

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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