Created
September 7, 2022 00:42
-
-
Save pivotaljohn/f08b255c71b5330b92dda5bd24ee8e9c to your computer and use it in GitHub Desktop.
Encoding a string value with proper indenting.
This file contains hidden or 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
#@ load("@ytt:data", "data") | |
#@ load("@ytt:yaml", "yaml") | |
#@ def config(): | |
#@yaml/text-templated-strings | |
config: | |
inputs: |- | |
(@ for app, ns in data.values.logging.apps: -@) | |
[INPUT] | |
app: (@= app @) | |
ns: (@= ns @) | |
(@ end @) | |
#@ end | |
--- | |
spec: | |
source: | |
helm: | |
values: #@ yaml.encode(config()) |
This file contains hidden or 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
#@data/values | |
--- | |
logging: | |
apps: [[app1, ns1], [app2, ns2]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment