Skip to content

Commit

Permalink
Update to reflect changes from helm/helm#10299
Browse files Browse the repository at this point in the history
* use modifier `delimiters=` instead of `delim=`
* specify full delimiters instead of duplicating the delimiter (`[,]` -> `[[,]]`)
* document the Template Header concept

Signed-off-by: Neer Friedman <neerfri@gmail.com>
  • Loading branch information
neerfri committed Nov 24, 2021
1 parent e5a28e1 commit db0fe3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hips/hip-9999.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ status: "draft"
## Abstract

Many tools use templating syntax with `{{ ... }}` delimiters, it's hard to maintain Helm charts for such tools.
This HIP suggests to use "magic comments" in the template to control the delimiter.
This HIP suggests to use "magic comments" (AKA modelines) in the template to control the delimiter.

## Motivation

Expand All @@ -26,10 +26,10 @@ a chart maintainer to only use the feature for templates that really need it and

## Specification

To change the template delimiter, a helm user would add a `# helm: delim=[,]` comment to the head of the template file:
To change the template delimiter, a helm user would add a `# helm: delimiters=[[,]]` comment to the head of the template file:

```yaml
# helm: delim=[,]
# helm: delimiters=[[,]]
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -38,13 +38,13 @@ data:
myvalue: "Hello {{world}}"
```

It's worth mentioning that the delimiter set in the `# helm: delim=[,]` is doubled in the actual template.
This is because otherwise the comment `# helm: delim=[[,]]` would make the template engine try to execute `[[,]]` and fail.
Magic comments will be read from the **Template Header**, all initial lines in a template upto the first line that does not start with "#".
The **Template Header** will be rendered in the final output but will not be processed by the template engine.


## Backwards compatibility

The feature will have no effect on charts that do not contain the `# helm: delim=[,]` comment.
The feature will have no effect on charts that do not contain the `# helm: delimiters=[[,]]` comment.
As such it has no backwards compatibility issues.

Given that the most likely reason to use the feature is the use of `{{ ... }}` in a chart template,
Expand Down

0 comments on commit db0fe3c

Please sign in to comment.