Support nested expressions
Hi,
I would like to use environment variables inside ref expression.
As I know, I can use ref+envsubst://$var to lookup environment variables. Now I would like to use within another expression, like:
ref+vault://ref+envsubst://$var/foo as native alternative to ref+vault://${var}/foo.
Is this supported by vals?
I hacked something like this using refs and secretrefs, in two passes, in the past. Not ideal tho
Since I looking for environment variables, what did you think about an CLI flag which enables expand env, before pass values to the backends?
What about something like --max-passes that would configure how many level of interpolation could be done in a single call?
Interpoling variables in the "shell" format may cause issues with other tools.
My previous use case pulled up the ref backend "prefix" from a configuration file, so it could be generalized in some backend agnostic configuration. eg:
# config.yml
vals_prefix: ref+gcpsecrets://project/prefix_
vals_suffix: ?param=foo+
# manifest.yml
access_key: ref+file:///config.yml#/vals_prefix+access_keyref+file:///config.yml#/vals_suffix+
If such option was available, I could have run vals a single time with something like --max-passes=2
I know this does not look that good but it was the best solution that fitted my constraints I was able to find at the time.
Hm, refer any external files (includes same) would not work well inside a Helm values.yaml executed on ArgoCD, because workdir is unknown