|
|
|
@ -97,7 +97,7 @@ type Configuration struct {
|
|
|
|
|
// renderResources renders the templates in a chart
|
|
|
|
|
//
|
|
|
|
|
// TODO: This function is badly in need of a refactor.
|
|
|
|
|
func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values, releaseName, outputDir string, subNotes, useReleaseName, includeCrds bool, pr postrender.PostRenderer, dryRun bool) ([]*release.Hook, *bytes.Buffer, string, error) {
|
|
|
|
|
func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values, releaseName, outputDir string, subNotes, useReleaseName, includeCrds bool, disableHooks bool, pr postrender.PostRenderer, dryRun bool) ([]*release.Hook, *bytes.Buffer, string, error) {
|
|
|
|
|
hs := []*release.Hook{}
|
|
|
|
|
b := bytes.NewBuffer(nil)
|
|
|
|
|
|
|
|
|
@ -210,6 +210,24 @@ func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !disableHooks && len(hs) > 0 {
|
|
|
|
|
for _, h := range hs {
|
|
|
|
|
if outputDir == "" {
|
|
|
|
|
fmt.Fprintf(b, "---\n# Source: %s\n%s\n", h.Path, h.Manifest)
|
|
|
|
|
} else {
|
|
|
|
|
newDir := outputDir
|
|
|
|
|
if useReleaseName {
|
|
|
|
|
newDir = filepath.Join(outputDir, releaseName)
|
|
|
|
|
}
|
|
|
|
|
err = writeToFile(newDir, h.Path, h.Manifest, fileWritten[h.Path])
|
|
|
|
|
if err != nil {
|
|
|
|
|
return hs, b, "", err
|
|
|
|
|
}
|
|
|
|
|
fileWritten[h.Path] = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if pr != nil {
|
|
|
|
|
b, err = pr.Run(b)
|
|
|
|
|
if err != nil {
|
|
|
|
|