hashicorp / hashicorp/consul

Update vendored version of HIL

Open
#5,240 1 comment 1 reaction 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

#### Feature Description

Consul currently vendors a version of [HIL](https://github.com/hashicorp/hil) from about 3 years ago, https://github.com/hashicorp/consul/tree/master/vendor/github.com/hashicorp/hil please can we update it to a more recent version? For example the current version does not have support for Conditionals.

#### Use Case(s)

This would allow more modern HIL syntax to be used in any place where config interpolation is done. One example might be prepared queries where HIL could be used to generate conditional tags. For example something like

```json
{
"Name": "something",
"Template": {
"Type": "name_prefix_match",
"Regexp": "^something\\.([\\w\\-]+)\\.([\\w\\-]+)$",
"RemoveEmptyTags": true
},
"Service": {
"Service": "${match(1)}-${match(2)}",
"Tags": [
"${${match(1) == \"kafka\" ? \"default\" : \"\"}"
],
}
}
```

Would allow optionally setting a tag if a query was against kafka. This is otherwise impossible when there is a prefix involved.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.