Skip to content

Commit

Permalink
chore(common): mustMerge* is the safer option (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau authored Jun 28, 2024
1 parent 95a932b commit 4299e1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions charts/common/templates/_helm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Returns a HelmRelease.spec.chart.spec for a given chart in a given repository.
{{- $_ = set . "Values" .context.Values -}}
{{- $spec := dict -}}
{{- if eq (dig .repo "type" "helm" .Values.global.helmRepositories) "helm" -}}
{{- $spec = merge (dict
{{- $spec = mustMerge (dict
"chart" .chart
"sourceRef" (dict
"kind" "HelmRepository"
Expand All @@ -34,7 +34,7 @@ Returns a HelmRelease.spec.chart.spec for a given chart in a given repository.
) $spec
-}}
{{- else -}}
{{- $spec = merge (dict
{{- $spec = mustMerge (dict
"chart" (dig .repo "charts" .chart "path" (printf "charts/%s" .chart) .Values.global.helmRepositories)
"sourceRef" (dict
"kind" "GitRepository"
Expand All @@ -46,4 +46,3 @@ Returns a HelmRelease.spec.chart.spec for a given chart in a given repository.
{{- end -}}
{{- $spec | toYaml -}}
{{- end -}}

4 changes: 2 additions & 2 deletions charts/common/templates/_resources.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Return a resource request/limit object based on a given preset or provided resou
{{- define "common.resources" -}}
{{- $resources := dict -}}
{{- if .resources -}}
{{- $resources = .resources | merge $resources -}}
{{- $resources = .resources | mustMerge $resources -}}
{{- end -}}
{{- if and .resourcesPreset (ne .resourcesPreset "none") -}}
{{- $resources = include "common.resources.preset" (dict "type" .resourcesPreset) | fromYaml | merge $resources -}}
{{- $resources = include "common.resources.preset" (dict "type" .resourcesPreset) | fromYaml | mustMerge $resources -}}
{{- end -}}
{{- toYaml $resources -}}
{{- end -}}
Expand Down

0 comments on commit 4299e1d

Please sign in to comment.