Skip to content

Commit

Permalink
helm: fix name of scylla clusters in Manager chart (#363)
Browse files Browse the repository at this point in the history
Wrong release name was filled by the Helm due to an open issue.

Fixes #363
  • Loading branch information
zimnx committed Feb 22, 2021
1 parent e4c457a commit 6d35b37
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions helm/scylla-manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,21 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Workaround of https://github.com/helm/helm/issues/3920
Call a template from the context of a subchart.
Usage:
{{ include "call-nested" (list . "<subchart_name>" "<subchart_template_name>") }}
*/}}
{{- define "call-nested" }}
{{- $dot := index . 0 }}
{{- $subchart := index . 1 | splitList "." }}
{{- $template := index . 2 }}
{{- $values := $dot.Values }}
{{- range $subchart }}
{{- $values = index $values . }}
{{- end }}
{{- include $template (dict "Chart" (dict "Name" (last $subchart)) "Values" $values "Release" $dot.Release "Capabilities" $dot.Capabilities) }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/scylla-manager/templates/manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
hosts:
{{- range $rack := .Values.scylla.racks }}
{{- range $idx, $e := until ($rack.members | int) }}
- {{ printf "%s-%s-%s-%d.%s.svc" $.Release.Name $.Values.scylla.datacenter $rack.name $idx $.Release.Namespace }}
- {{ printf "%s-%s-%s-%d.%s.svc" ( include "call-nested" (list $ "scylla" "scylla.fullname")) $.Values.scylla.datacenter $rack.name $idx $.Release.Namespace }}
{{- end }}
{{- end }}
kind: ConfigMap
Expand Down

0 comments on commit 6d35b37

Please sign in to comment.