From 6969f1a28749706e308e1a2e8222953d9ee65dba Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 12 Sep 2024 11:54:24 -0400 Subject: [PATCH] add PrivateCACert template function (#4878) * add AdditionalTLSCACert template function * Update pkg/template/static_context.go Co-authored-by: Alex Parker <7272359+ajp-io@users.noreply.github.com> --------- Co-authored-by: Alex Parker <7272359+ajp-io@users.noreply.github.com> --- pkg/template/static_context.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/template/static_context.go b/pkg/template/static_context.go index 270f97144a..ad2a3fcff1 100644 --- a/pkg/template/static_context.go +++ b/pkg/template/static_context.go @@ -110,6 +110,8 @@ func (ctx StaticCtx) FuncMap() template.FuncMap { funcMap["Lookup"] = ctx.lookup + funcMap["PrivateCACert"] = ctx.privateCACert + return funcMap } @@ -676,3 +678,8 @@ func (ctx StaticCtx) lookup(apiversion string, resource string, namespace string } return obj } + +func (ctx StaticCtx) privateCACert() string { + // return the name of a configmap holding additional CA certificates provided by the end user at install time + return os.Getenv("SSL_CERT_CONFIGMAP") +}