You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot create a template that contains a component that requires variables. Specifically, I am trying to update the KV explorer to use the config store for user/pass credentials, which requires adding variables to the template: fermyon/spin-kv-explorer#27.
the template system sees {{ secret }} as a reference to a template variable. Double braces need to be escaped. From initial tests,
{% raw %}kv_credentials = "{{ secret }}"{% endraw %}
at least doesn't error; I will update the unit test to verify it produces the right result. I should also update the docs to tell people how to do this!
Problem
I cannot create a template that contains a component that requires variables. Specifically, I am trying to update the KV explorer to use the config store for user/pass credentials, which requires adding variables to the template: fermyon/spin-kv-explorer#27.
This shows up in the Spin tests if you update update the add-variables test template as done here to include a component that requires the variables added via
variables.txt
. If you then run themanager::tests::can_add_variables_from_template
test, it errors withIt seems we may need to expand upon variables support in templates (added here #1864) to consider the case when a component is being added.
Solution
I tried updating the
renderer
andwriter
to process "variables" first but was not successful.The text was updated successfully, but these errors were encountered: