Ability to have loops within yaml and json to support collections #222
-
(I believe this might have been asked for before but couldn't find it anywhere) Sometimes, you will have a case where you want to have a variable amount of items defined in the configuration. For example, when defining a synthetic test, you can have multiple locations assigned to it: test.json: "locations": [
"{{ .locationone }}",
"{{ .locationtwo }}"
], test.yaml:
At the moment, you can define a variable for each location individually, but you would need a template for each test type per number of locations. Therefor, it would be great if we could support collections, not unlike how helm supports it: test.yaml:
test.json:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
btw, a current workaround is to supply the json directly in the variable: test.json "locations": [ {{ .locations }} ], test.yaml test-one:
- locations: "\"LOCATIONONE-ID\", \"LOCATIONTWO-ID\"" However that is not a clean solution and would get quite complex when the collection is also a multi attribute item. |
Beta Was this translation helpful? Give feedback.
-
With monaco 2.0 this will change. More complex data structure will be possible. |
Beta Was this translation helpful? Give feedback.
With monaco 2.0 this will change. More complex data structure will be possible.