From 1082204ac7c1e0d0859369c0d69a19aa03f20148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Tue, 4 Oct 2022 17:11:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20Add=20note=20about=20.Chart.IsRo?= =?UTF-8?q?ot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slides/k8s/helm-dependencies.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/slides/k8s/helm-dependencies.md b/slides/k8s/helm-dependencies.md index 6f65ca90..5ee133a2 100644 --- a/slides/k8s/helm-dependencies.md +++ b/slides/k8s/helm-dependencies.md @@ -317,6 +317,22 @@ class: extra-details class: extra-details +## Determining if we're in a subchart + +- `.Chart.IsRoot` indicates if we're in the top-level chart or in a sub-chart + +- Useful in charts that are designed to be used standalone or as dependencies + +- Example: generic chart + + - when used standalone (`.Chart.IsRoot` is `true`), use `.Release.Name` + + - when used as a subchart e.g. with multiple aliases, use `.Chart.Name` + +--- + +class: extra-details + ## Compatibility with Helm 2 - Chart `apiVersion: v1` is the only version supported by Helm 2