gomplate | flexible commandline tool for template rendering | DevOps library
kandi X-RAY | gomplate Summary
kandi X-RAY | gomplate Summary
gomplate is a template renderer which supports a growing list of datasources, such as: JSON (including EJSON - encrypted JSON), YAML, AWS EC2 metadata, BoltDB, Hashicorp Consul and Hashicorp Vault secrets.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gomplate
gomplate Key Features
gomplate Examples and Code Snippets
Community Discussions
Trending Discussions on gomplate
QUESTION
I was trying out gomplate and encountered an error.
For context I've defined a template file, test.tmplt, and a datasource file, dev.yaml.
test.tmplt has the following content :
ANSWER
Answered 2020-Nov-19 at 10:09Your "k8s"
data source is a YAML config, and you want to access the api-advertise-ip
property of it.
Since api-advertise-ip
contains dashes, you can't use the name as-is in the template, because that's a syntax error: the template engine tries to use api
as the property name, and the dash after that is a syntax error.
You have to put the property name in quotes that contains dashes: "api-advertise-ip"
, but this using the .
selector is also invalid syntax.
Use the builtin index
function to index the YAML datasource with this key:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gomplate
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page