📄 Templating
Helmwave uses Go templates for templating.
Helmwave supports all built-in functions / sprig / gomplate / custom.
Sprig
If you've ever written helm charts, then you're already familiar with it.
http://masterminds.github.io/sprig/
Gomplate
Since v0.14.0. Helmwave works with Gomplate.
How to enable gomplate for v0.14.0 helmwave
helmwave.yml
template:
gomplate:
enabled: true
Usage
repositories:
- name: bitnami
url: https://charts.bitnami.com/bitnami
template:
gomplate:
enabled: true
data:
sources:
secret:
url:
scheme: aws+sm
path: 'hello/foobar'
releases:
- name: app
chart:
name: bitnami/nginx
namespace: test
values:
- vaules-secret.yaml
Issues
- https://github.com/helmwave/helmwave/issues/159
- https://github.com/helmwave/helmwave/issues/103
Custom
toYamlmarshals a map into a stringfromYamlreads a golang string and generates a mapreadFileget file as stringhasKeyget true if field is existsget(Sprig's originalgetis available assprigGet)setValueAtPathPATH NEW_VALUE traverses a golang map, replaces the value at the PATH with NEW_VALUErequiredEnvThe requiredEnv function allows you to declare a particular environment variable as required for template rendering. If the environment variable is unset or empty, the template rendering will fail with an error message.