mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-04 20:21:24 -03:00
rename some files
This commit is contained in:
@@ -1,39 +1,21 @@
|
||||
{{/* Certificate Spawwner */}}
|
||||
{{/* Call this template:
|
||||
{{ include "tc.v1.common.spawner.scaleCertificate" $ -}}
|
||||
*/}}
|
||||
{{/* Renders the certificate objects required by the chart */}}
|
||||
{{- define "tc.v1.common.spawner.certificate" -}}
|
||||
{{/* Generate named certs as required */}}
|
||||
{{- range $name, $cert := .Values.cert -}}
|
||||
{{- if $cert.enabled -}}
|
||||
{{- $certValues := $cert -}}
|
||||
{{- $certName := include "tc.v1.common.lib.chart.names.fullname" $ -}}
|
||||
|
||||
{{- define "tc.v1.common.spawner.scaleCertificate" -}}
|
||||
{{/* set defaults */}}
|
||||
{{- if and (not $certValues.nameOverride) (ne $name (include "tc.v1.common.lib.util.cert.primary" $)) -}}
|
||||
{{- $_ := set $certValues "nameOverride" $name -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $name, $certificate := .Values.scaleCertificate -}}
|
||||
|
||||
{{- if $certificate.enabled -}}
|
||||
|
||||
{{/* Create a copy of the certificate */}}
|
||||
{{- $objectData := (mustDeepCopy $certificate) -}}
|
||||
|
||||
{{- $objectName := (printf "%s-%s" (include "tc.v1.common.lib.chart.names.fullname" $) $name) -}}
|
||||
{{/* Perform validations */}}
|
||||
{{- include "tc.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}}
|
||||
{{- include "tc.v1.common.lib.scaleCertificate.validation" (dict "objectData" $objectData) -}}
|
||||
{{- include "tc.v1.common.lib.metadata.validation" (dict "objectData" $objectData "caller" "Certificate") -}}
|
||||
|
||||
{{/* Prepare data */}}
|
||||
{{- $data := fromJson (include "tc.v1.common.lib.scaleCertificate.getData" (dict "rootCtx" $ "objectData" $objectData)) -}}
|
||||
{{- $_ := set $objectData "data" $data -}}
|
||||
|
||||
{{/* Set the type to certificate */}}
|
||||
{{- $_ := set $objectData "type" "certificate" -}}
|
||||
|
||||
{{/* Set the name of the certificate */}}
|
||||
{{- $_ := set $objectData "name" $objectName -}}
|
||||
{{- $_ := set $objectData "shortName" $name -}}
|
||||
|
||||
{{/* Call class to create the object */}}
|
||||
{{- include "tc.v1.common.class.secret" (dict "rootCtx" $ "objectData" $objectData) -}}
|
||||
{{- if $certValues.nameOverride -}}
|
||||
{{- $certName = printf "%v-%v" $certName $certValues.nameOverride -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "tc.v1.common.class.certificate" (dict "root" $ "name" $certName "certificateIssuer" $cert.certificateIssuer "hosts" $cert.hosts ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
39
library/common/templates/spawner/_scaleCertificate.tpl
Normal file
39
library/common/templates/spawner/_scaleCertificate.tpl
Normal file
@@ -0,0 +1,39 @@
|
||||
{{/* Certificate Spawwner */}}
|
||||
{{/* Call this template:
|
||||
{{ include "tc.v1.common.spawner.scaleCertificate" $ -}}
|
||||
*/}}
|
||||
|
||||
{{- define "tc.v1.common.spawner.scaleCertificate" -}}
|
||||
|
||||
{{- range $name, $certificate := .Values.scaleCertificate -}}
|
||||
|
||||
{{- if $certificate.enabled -}}
|
||||
|
||||
{{/* Create a copy of the certificate */}}
|
||||
{{- $objectData := (mustDeepCopy $certificate) -}}
|
||||
|
||||
{{- $objectName := (printf "%s-%s" (include "tc.v1.common.lib.chart.names.fullname" $) $name) -}}
|
||||
{{/* Perform validations */}}
|
||||
{{- include "tc.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}}
|
||||
{{- include "tc.v1.common.lib.scaleCertificate.validation" (dict "objectData" $objectData) -}}
|
||||
{{- include "tc.v1.common.lib.metadata.validation" (dict "objectData" $objectData "caller" "Certificate") -}}
|
||||
|
||||
{{/* Prepare data */}}
|
||||
{{- $data := fromJson (include "tc.v1.common.lib.scaleCertificate.getData" (dict "rootCtx" $ "objectData" $objectData)) -}}
|
||||
{{- $_ := set $objectData "data" $data -}}
|
||||
|
||||
{{/* Set the type to certificate */}}
|
||||
{{- $_ := set $objectData "type" "certificate" -}}
|
||||
|
||||
{{/* Set the name of the certificate */}}
|
||||
{{- $_ := set $objectData "name" $objectName -}}
|
||||
{{- $_ := set $objectData "shortName" $name -}}
|
||||
|
||||
{{/* Call class to create the object */}}
|
||||
{{- include "tc.v1.common.class.secret" (dict "rootCtx" $ "objectData" $objectData) -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
@@ -1,21 +0,0 @@
|
||||
{{/* Renders the certificate objects required by the chart */}}
|
||||
{{- define "tc.v1.common.spawner.certificate" -}}
|
||||
{{/* Generate named certs as required */}}
|
||||
{{- range $name, $cert := .Values.cert -}}
|
||||
{{- if $cert.enabled -}}
|
||||
{{- $certValues := $cert -}}
|
||||
{{- $certName := include "tc.v1.common.lib.chart.names.fullname" $ -}}
|
||||
|
||||
{{/* set defaults */}}
|
||||
{{- if and (not $certValues.nameOverride) (ne $name (include "tc.v1.common.lib.util.cert.primary" $)) -}}
|
||||
{{- $_ := set $certValues "nameOverride" $name -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $certValues.nameOverride -}}
|
||||
{{- $certName = printf "%v-%v" $certName $certValues.nameOverride -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "tc.v1.common.class.certificate" (dict "root" $ "name" $certName "certificateIssuer" $cert.certificateIssuer "hosts" $cert.hosts ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user