From d407755137dfb54e33c98e670c7b208f920dcc94 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 11 Sep 2024 15:45:53 -0400 Subject: [PATCH 1/3] add AdditionalTLSCACert template function --- 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..097aceec8f 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["AdditionalTLSCACert"] = ctx.additionalTLSCACert + return funcMap } @@ -676,3 +678,8 @@ func (ctx StaticCtx) lookup(apiversion string, resource string, namespace string } return obj } + +func (ctx StaticCtx) additionalTLSCACert() 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") +} From a4e7ab030bf2b695de1315c7b47bb77b3b9a9bf5 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 12 Sep 2024 09:33:01 -0400 Subject: [PATCH 2/3] Update pkg/template/static_context.go Co-authored-by: Alex Parker <7272359+ajp-io@users.noreply.github.com> --- pkg/template/static_context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/template/static_context.go b/pkg/template/static_context.go index 097aceec8f..2bd0457005 100644 --- a/pkg/template/static_context.go +++ b/pkg/template/static_context.go @@ -110,7 +110,7 @@ func (ctx StaticCtx) FuncMap() template.FuncMap { funcMap["Lookup"] = ctx.lookup - funcMap["AdditionalTLSCACert"] = ctx.additionalTLSCACert + funcMap["PrivateCACert"] = ctx.additionalTLSCACert return funcMap } From 5ea1010ef0e57222838537f17491952bd8995c52 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Thu, 12 Sep 2024 10:25:35 -0400 Subject: [PATCH 3/3] rename 'additionalTLSCACert' function to 'privateCACert' --- pkg/template/static_context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/template/static_context.go b/pkg/template/static_context.go index 2bd0457005..ad2a3fcff1 100644 --- a/pkg/template/static_context.go +++ b/pkg/template/static_context.go @@ -110,7 +110,7 @@ func (ctx StaticCtx) FuncMap() template.FuncMap { funcMap["Lookup"] = ctx.lookup - funcMap["PrivateCACert"] = ctx.additionalTLSCACert + funcMap["PrivateCACert"] = ctx.privateCACert return funcMap } @@ -679,7 +679,7 @@ func (ctx StaticCtx) lookup(apiversion string, resource string, namespace string return obj } -func (ctx StaticCtx) additionalTLSCACert() string { +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") }