-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templateargs: Deal with YAML's handling of "y" as boolean
When using yab templates and a key is specified as `"y"` (with quoting), the template parsing ends up converting this to `y`, which then gets unmarshalled as a boolean. The underlying cause is: go-yaml/yaml#214 This is caused by template rendering's use of `yaml.Unmarshal` on all string values which can lose the type. This change restricts the `Unmarshal` to values that were modified as part of the rendering step. It also adds special logic to protect against YAML's boolean handling, by only using the boolean value if strconv.ParseBool would parse the value. This means if a value was rendered as `y`, we would still not treat it as a boolean. Fixes #253
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters