Open DanieldeR opened 2 years ago
This is a general concern that could impact all templated values, not just params. How cartographer is currently handling types is correct to preserves the type and not attempt to automatically convert. That said, I think cartographer could be a bit more capable in how the template expression are resolved. I know this could quickly snowball, we should be very conservative with the syntax and explore multiple options.
One possible approach to is defined a well known set of method filters after the expression to transform the resolved value before it is substituted. $(pathExpression | filterFunc)$
. A current expression like $(workload.spec.params[?(@.name=='hello')].value)$
could be enriched to $(workload.spec.params[?(@.name=='hello')].value | asString)$
.
As a template author I want to be able to coerce non-strings to strings So that I can fulfill the contract of the objects I am deploying