con2 / con2/emrichen

Nested templating variable precedence

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
110
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Hi,

Considering a template like
```
# generic.yaml
!Defaults
name: Unknown name
greeting: Unknown greeting
---
phrase: !Format "{greeting} {name}"
```

Which is templated once, with results as expected (`phrase: Hello Mark`):

```
# hello_mark.yaml
!With
template: generic.yaml
vars:
name: Mark
greeting: Hello
```

and then another template on top of the previous one

```
# hello_john.yaml
!With
template: hello_mark.yaml
vars:
name: John
```

I expected it to result in `phrase: Hello John` but rather I got still `phrase: Hello Mark`. So it seems that the first (lower level) variables within the !With tag cannot be overriden by higher level !With templates.

Is this by design? Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.