From bbaa57cbcbce819803b8edc65d6c52ec1ca0e75f Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Mon, 25 Nov 2024 09:43:13 -0500 Subject: [PATCH] Delete duplicated pfcon.valueOrLookupOrRandom --- charts/pfcon/templates/_helpers.tpl | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/charts/pfcon/templates/_helpers.tpl b/charts/pfcon/templates/_helpers.tpl index 17b2c51..ebbb0b2 100644 --- a/charts/pfcon/templates/_helpers.tpl +++ b/charts/pfcon/templates/_helpers.tpl @@ -62,27 +62,3 @@ Create the name of the service account to use {{ .Values.storage.existingClaim | default (printf "%s-storebase" .Release.Name) }} {{- end }} -{{/* -Helper function to use a value. If the value is unset, try looking up the previous value -from a secret. If the secret does not exist, generate a random value with a specified length. -*/}} -{{- define "pfcon.valueOrLookupOrRandom" -}} -{{- if .value -}} - {{- .value | b64enc | quote -}} -{{- else -}} - {{- $length := .length | default 32 -}} - {{- $name := .name -}} - {{- if (not $name) -}} - {{- fail (printf "valueOrLookupOrRandom was not called with required parameter 'name'. Given parameters: %s" (keys .)) -}} - {{- end -}} - {{- with (lookup "v1" "Secret" .root.Release.Namespace .secret) -}} - {{- if (hasKey .data $name) -}} - {{- (index .data $name) | quote -}} - {{- else -}} - {{- randAlphaNum $length | b64enc | quote -}} - {{- end -}} - {{- else -}} - {{- randAlphaNum $length | b64enc | quote -}} - {{- end -}} -{{- end -}} -{{- end -}}