Skip to content

Commit

Permalink
add PrivateCACertNamespace function
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Sep 12, 2024
1 parent ef6c2e9 commit 6cf0941
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/template/static_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (ctx StaticCtx) FuncMap() template.FuncMap {
funcMap["Lookup"] = ctx.lookup

funcMap["PrivateCACert"] = ctx.privateCACert
funcMap["PrivateCACertNamespace"] = ctx.privateCACertNamespace

return funcMap
}
Expand Down Expand Up @@ -683,3 +684,11 @@ 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")
}

func (ctx StaticCtx) privateCACertNamespace() string {
// return the namespace of a configmap holding additional CA certificates provided by the end user at install time
if os.Getenv("SSL_CERT_CONFIGMAP_NAMESPACE") != "" {
return os.Getenv("SSL_CERT_CONFIGMAP_NAMESPACE")
}
return ctx.namespace()
}

0 comments on commit 6cf0941

Please sign in to comment.