mirror of
https://github.com/truenas/charts.git
synced 2026-06-18 01:26:53 +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" . -}}
|
||||
{{- $root := .root -}}
|
||||
|
||||
{{- $certName := "TODO: Get the certName" -}}
|
||||
|
||||
{{- if (include "ix.v1.common.certificate.exists" (dict "root" $root "certName" $certName)) }}
|
||||
{{- $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" . }}
|
||||
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