From 4785b0f4c1a48a7f15ec8d4f5b62282811e14429 Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Mon, 1 Jul 2024 12:00:58 +0200 Subject: [PATCH] chore(common): improve developer experience by providing tab-completion (#1004) --- charts/common/templates/_helm.tpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/common/templates/_helm.tpl b/charts/common/templates/_helm.tpl index f157c5163..7cb6da5ba 100644 --- a/charts/common/templates/_helm.tpl +++ b/charts/common/templates/_helm.tpl @@ -11,7 +11,7 @@ Returns the chart version for a given chart in a given repository. {{ include "common.helm.chartVersion" (dict "context" $ "repo" "bitnami" "chart" "redis") -}} */}} {{- define "common.helm.chartVersion" -}} - {{- $_ := set . "Values" .context.Values -}} + {{- $_ := mustMerge . (pick .context "Values") -}} {{- dig .repo "charts" .chart nil .Values.global.helmRepositories | required (printf "The repo '%s' is either missing or doesn't contain the chart '%s'" .repo .chart) -}} {{- end -}} @@ -20,8 +20,7 @@ Returns a HelmRelease.spec.chart.spec for a given chart in a given repository. {{ include "common.helm.chartSpec" (dict "context" $ "repo" "bitnami" "chart" "redis" "prependReleaseName" true) -}} */}} {{- define "common.helm.chartSpec" -}} - {{- $_ := set . "Release" .context.Release -}} - {{- $_ = set . "Values" .context.Values -}} + {{- $_ := mustMerge . (pick .context "Values" "Release") -}} {{- $spec := dict -}} {{- if eq (dig .repo "type" "helm" .Values.global.helmRepositories) "helm" -}} {{- $spec = mustMerge (dict