Skip to content

Commit 6dabd1c

Browse files
authored
docs: add templating delimiters doc to readme (#105)
On-behalf-of: Radek Schekalla (SAP) <[email protected]> Signed-off-by: Radek Schekalla (SAP) <[email protected]>
1 parent 15475a9 commit 6dabd1c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,27 @@ Example:
204204
openmcp-bootstrapper manage-deployment-repo --kubeconfig ~/.kube/config --ocm-config ./examples/ocm-config.yaml --git-config ./examples/git-config.yaml --extra-manifest-dir ./my-custom-manifests ./examples/bootstrapper-config.yaml
205205
```
206206

207+
### Templating (delimiters)
208+
The `manage-deployment-repo` command templates the openMCP git ops templates using the [Go text/template package](https://pkg.go.dev/text/template).
209+
By default, the delimiters `{{` and `}}` are used for templating.
210+
If your custom manifests in the `extra-manifest-dir` also use these delimiters, but are not meant to be templated by the bootstrapper, you can change the delimiters used by the bootstrapper by adding the following comment at the top of your custom manifest files:
211+
212+
```yaml
213+
#?bootstrap {"template": {"delims": {"start": "<<", "end": ">>"}}}
214+
```
215+
216+
Example:
217+
```yaml
218+
#?bootstrap {"template": {"delims": {"start": "<<", "end": ">>"}}}
219+
apiVersion: v1
220+
kind: ConfigMap
221+
metadata:
222+
name: my-configmap
223+
data:
224+
foo: "<< .Values.myValue >>" # This will be templated by the bootstrapper
225+
bar: "{{ .Values.myValue }}" # This will *not* be templated by the bootstrapper
226+
```
227+
207228
## Requirements and Setup
208229

209230
This project uses the [cobra library](https://github.com/spf13/cobra) for command line parsing.

0 commit comments

Comments
 (0)