feat(yaml): Support extVar to yaml command
What
feat(yaml): Support extVar to yaml command
Support passing the --ext-str
option to the yaml
command just like
in the test
command.
Also support passing --ext-code
Why
We'd like to load a different recordingRuleRegistry
when generating mimir rules compared to Prometheus / Thanos rules as in gitlab-com/runbooks!6874 (merged)
Test
❯ cat test.jsonnet
{
'test.yml': '{%s: %s}' % [std.extVar('key'), std.extVar('value')],
}
❯ go run main.go yaml --ext-str key=hello --ext-code value=1+1 test.jsonnet
cat test.yml
❯ cat test.yml
hello: 2
Edited by Gregorius Marco