Skip to content

Commit

Permalink
[helm] template label helper as range (aptos-labs#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin authored Jul 30, 2022
1 parent cdfa305 commit 3e29dcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions terraform/helm/aptos-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "aptos-validator.labels" -}}
{{ toYaml .Values.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v }}
{{- end }}
helm.sh/chart: {{ include "aptos-validator.chart" . }}
{{ include "aptos-validator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
Expand All @@ -48,7 +50,9 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
Selector labels
*/}}
{{- define "aptos-validator.selectorLabels" -}}
{{ toYaml .Values.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v }}
{{- end }}
app.kubernetes.io/part-of: {{ include "aptos-validator.name" . }}
app.kubernetes.io/managed-by: helm
{{- end -}}
Expand Down
8 changes: 6 additions & 2 deletions terraform/helm/genesis/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "aptos-genesis.labels" -}}
{{ toYaml .Values.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v }}
{{- end }}
helm.sh/chart: {{ include "aptos-genesis.chart" . }}
{{ include "aptos-genesis.selectorLabels" . }}
{{- if .Chart.AppVersion }}
Expand All @@ -48,7 +50,9 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
Selector labels
*/}}
{{- define "aptos-genesis.selectorLabels" -}}
{{ toYaml .Values.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v }}
{{- end }}
app.kubernetes.io/part-of: {{ include "aptos-genesis.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
Expand Down

0 comments on commit 3e29dcd

Please sign in to comment.