feat: allow arguments to be passed to templates
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{- define "common.serviceMonitor.secret.tpl" -}}
|
||||
{{- $basicAuth := .Values.serviceMonitor.basicAuth | default (dict) -}}
|
||||
{{- $top := first . -}}
|
||||
{{- $serviceMonitor := index . 1 -}}
|
||||
{{- $basicAuth := $serviceMonitor.basicAuth | default (dict) -}}
|
||||
metadata:
|
||||
name: {{ $basicAuth.secretName | default (include "common.fullname" .) }}
|
||||
{{- with .Values.serviceMonitor.namespace }}
|
||||
name: {{ $basicAuth.secretName | default (include "common.fullname" $top) }}
|
||||
{{- with $serviceMonitor.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
{{- if $basicAuth.enabled }}
|
||||
@ -14,14 +16,10 @@ data:
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceMonitor.secret.if" -}}
|
||||
{{- define "common.serviceMonitor.secret" -}}
|
||||
{{- $top := first . -}}
|
||||
{{- $serviceMonitor := $top.Values.serviceMonitor | default (dict) -}}
|
||||
{{- $serviceMonitor := index . 1 -}}
|
||||
{{- if $serviceMonitor.enabled -}}
|
||||
{{- include "common.secret" (append . "common.serviceMonitor.secret.tpl") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceMonitor.secret" -}}
|
||||
{{- include "common.utils.flattenCall" (list "common.serviceMonitor.secret.if" .) -}}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user