From a7f85c693d8100aaaeac72668ea7974cc5aa1229 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 8 Feb 2021 02:44:44 +0500 Subject: [PATCH] Consider cert key as a string in library chart --- library/common/2101.0.0/templates/lib/resources/_certs.tpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/common/2101.0.0/templates/lib/resources/_certs.tpl b/library/common/2101.0.0/templates/lib/resources/_certs.tpl index 740920d6f9..9e091595e9 100644 --- a/library/common/2101.0.0/templates/lib/resources/_certs.tpl +++ b/library/common/2101.0.0/templates/lib/resources/_certs.tpl @@ -4,7 +4,7 @@ Retrieve true/false if certificate is available in ixCertificates {{- define "common.resources.cert_present" -}} {{- $values := . -}} {{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- hasKey $values.ixCertificates $values.commonCertOptions.certKeyName -}} +{{- hasKey $values.Values.ixCertificates ($values.commonCertOptions.certKeyName | toString) -}} {{- end -}} @@ -14,8 +14,9 @@ Retrieve certificate from variable name {{- define "common.resources.cert" -}} {{- $values := . -}} {{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- if hasKey $values.ixCertificates $values.commonCertOptions.certKeyName -}} -{{- $cert := get $values.ixCertificates $values.commonCertOptions.certKeyName -}} +{{- $certKey := ($values.commonCertOptions.certKeyName | toString) -}} +{{- if hasKey $values.Values.ixCertificates $certKey -}} +{{- $cert := get $values.Values.ixCertificates $certKey -}} {{- if $values.commonCertOptions.publicKey -}} {{ $cert.certificate }} {{- else -}}