mirror of
https://github.com/truenas/charts.git
synced 2026-06-28 00:06:45 +08:00
adapt spawner to just retrieve a key if needed
This commit is contained in:
@@ -2,9 +2,11 @@
|
|||||||
{{- $secretName := include "ix.v1.common.names.fullname" . -}}
|
{{- $secretName := include "ix.v1.common.names.fullname" . -}}
|
||||||
{{- $root := .root -}}
|
{{- $root := .root -}}
|
||||||
|
|
||||||
{{- $certName := "TODO: Get the certName" -}}
|
{{- $certName := .certName -}}
|
||||||
|
{{- if (include "ix.v1.common.certificate.exists" (dict "root" $root "certName" $certName)) -}}
|
||||||
{{- if (include "ix.v1.common.certificate.exists" (dict "root" $root "certName" $certName)) }}
|
{{- if .key -}}
|
||||||
|
{{- include "ix.v1.common.certificate.get" (dict "root" $root "certName" $certName "key" "certificate") -}}
|
||||||
|
{{- else }}
|
||||||
---
|
---
|
||||||
apiVersion: {{ include "ix.v1.common.capabilities.secret.apiVersion" . }}
|
apiVersion: {{ include "ix.v1.common.capabilities.secret.apiVersion" . }}
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
18
library/common/1.0.0/templates/spawner/_certificate.tpl
Normal file
18
library/common/1.0.0/templates/spawner/_certificate.tpl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{{/*
|
||||||
|
Call this from anywhere to create a Secret/k8s.tls
|
||||||
|
Pass a "root" object and the "certName"
|
||||||
|
(certName comes from Scale's GUI definitions)
|
||||||
|
If you also pass a "key" when calling this spawner,
|
||||||
|
instead of creating a secret it will return you the value
|
||||||
|
of that key (if exists)
|
||||||
|
*/}}
|
||||||
|
{{- define "ix.v1.common.spawner.certificate" -}}
|
||||||
|
{{- $certName := .certName -}}
|
||||||
|
{{- $root := .root -}}
|
||||||
|
|
||||||
|
{{- if .key -}}
|
||||||
|
{{- include "ix.v1.common.class.certificate" (dict "root" $root "key" .key "certName" .certName) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- include "ix.v1.common.class.certificate" (dict "root" $root "certName" .certName) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
Reference in New Issue
Block a user