From 06ae6f933a22fda6f6246597dfba9be593772e34 Mon Sep 17 00:00:00 2001 From: Kai Takac Date: Mon, 2 Aug 2021 21:22:17 +0200 Subject: [PATCH] Make Chart's IsRoot available to templates Signed-off-by: Kai Takac --- pkg/engine/engine.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 4da64f5cc..7bfb72234 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -345,8 +345,13 @@ func allTemplates(c *chart.Chart, vals chartutil.Values) map[string]renderable { // As it recurses, it also sets the values to be appropriate for the template // scope. func recAllTpls(c *chart.Chart, templates map[string]renderable, vals chartutil.Values) { + chartMetaData := struct { + chart.Metadata + IsRoot bool + }{*c.Metadata, c.IsRoot()} + next := map[string]interface{}{ - "Chart": c.Metadata, + "Chart": chartMetaData, "Files": newFiles(c.Files), "Release": vals["Release"], "Capabilities": vals["Capabilities"],