https://garden.io logo
#🌱|help-and-getting-started
Debugging template variables
# 🌱|help-and-getting-started
i

icy-furniture-17516

03/31/2023, 11:06 AM
Is there an easy way to debug a) what variables are available and b) what is the value (recursively) of a variable in a given template?
q

quaint-dress-831

03/31/2023, 12:46 PM
Can you clarify what you mean by available variables? In Module Templates or templating variables with Garden's built-in helpers? If Module Templates, do you want the values of a provided JSON Schema? https://docs.garden.io/using-garden/module-templates#defining-and-referencing-inputs
I haven't used our Module Templates (yet) so I'd need to pull down our example and play with it if that's what you're referring to
i

icy-furniture-17516

04/02/2023, 4:05 AM
sorry, but by template I meant a garden.yaml file or a kubernetes file, that is parsed and processed as a template (and definitely not module templates, we havent' played with that either)
the docs https://docs.garden.io/using-garden/variables-and-templating say: > Note that while this syntax looks similar to template strings in Javascript, we don't allow arbitrary JS expressions. See the next section for the available expression syntax. fair enough, but I haven't found anything about how I could inspect a variable, so that I can discover what field are available at any given context. How do devs do this? (should I just ask in the dev channel?)
q

quaint-dress-831

04/02/2023, 1:22 PM
#dev is for dev talk on Garden OSS (which you're very welcome to take part in but I'd like to keep concerns separate). I'll escalate. If you can provide a specific example of the variable you're trying to inspect, that'd be super helpful 🙂
How pressing is this? Are you ok waiting until Tuesday when we meet to have an answer?
i

icy-furniture-17516

04/02/2023, 9:31 PM
Not pressing atm. I was specifically looking at
this
and
module
, but I'm more interested in the method, then the result (want to learn how to fish)
5 Views