From 97a9586a1b185102c7aa84c34276c0be8a622d43 Mon Sep 17 00:00:00 2001 From: Ladicle Date: Mon, 30 May 2016 17:09:53 +0900 Subject: [PATCH] fix(tiller): fix install function Because, occur the following error when `createNS` flag is true. `panic: template: redefinition of template "manifest"` --- pkg/client/install.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/client/install.go b/pkg/client/install.go index ae3a4f6ea..1131ba631 100644 --- a/pkg/client/install.go +++ b/pkg/client/install.go @@ -40,17 +40,18 @@ func NewInstaller() *Installer { func (i *Installer) Install(verbose, createNS bool) error { var b bytes.Buffer - t := template.New("manifest").Funcs(sprig.TxtFuncMap()) // Add namespace if createNS { - if err := template.Must(t.Parse(NamespaceYAML)).Execute(&b, i); err != nil { + nstpl := template.New("namespace").Funcs(sprig.TxtFuncMap()) + if err := template.Must(nstpl.Parse(NamespaceYAML)).Execute(&b, i); err != nil { return err } } // Add main install YAML - if err := template.Must(t.Parse(InstallYAML)).Execute(&b, i); err != nil { + istpl := template.New("install").Funcs(sprig.TxtFuncMap()) + if err := template.Must(istpl.Parse(InstallYAML)).Execute(&b, i); err != nil { return err }