cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
233 stars 64 forks source link

Evaluate trust namespace value as template #291

Open heruan opened 5 months ago

heruan commented 5 months ago

When installing trust-manager as a subchart (i.e. dependency) it would be useful to automatically set the trust namespace value to the release namespace, or another dynamic value. At the moment this is unfortunately not possibile since the app.trust.namespace value is evaluated as-is and so it needs to be always explicitly specified if you don't want the default one.

This can be easily solved if the value were evaluated as a template, e.g.

 metadata:
   name: {{ include "trust-manager.name" . }}
-  namespace: {{ .Values.app.trust.namespace }}
+  namespace: {{ tpl .Values.app.trust.namespace . }}

Then it would be possibile to set the trust namespace dynamically, e.g.

# Subchart configuration when trust-manager is a dependency
trust-manager:
  app:
    trust:
      namespace: {{ .Release.Namespace }}

Is this something that might be worth a PR? I'd be happy to contribute!