Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spire-server] go template variable issue #5574

Closed
kfox1111 opened this issue Oct 14, 2024 · 1 comment · Fixed by #5576
Closed

[spire-server] go template variable issue #5574

kfox1111 opened this issue Oct 14, 2024 · 1 comment · Fixed by #5576
Labels
priority/backlog Issue is approved and in the backlog

Comments

@kfox1111
Copy link
Contributor

kfox1111 commented Oct 14, 2024

When loading a go-template into one of the plugins in the config file, and env substitution is enabled (default), env substitution eats all variables, and there currently is no way to escape the variables so the env substitution doesn't eat them.

As a work around, I was able to set an environment variable in the env of the spire server:
d=$

and then use that as a hack around the issue:
agent_template = "{{ ${d}foo := \"thing\" }}{{ ${d}foo }}"

Maybe the spire-server itself could try and set an env var named $ to value $ at start, and then maybe this might work:
agent_template = "{{ $$foo := \"thing\" }}{{ $$foo }}"

@azdagron azdagron added triage/in-progress Issue triage is in progress priority/backlog Issue is approved and in the backlog labels Oct 15, 2024
@azdagron
Copy link
Member

Seems reasonable to fix.

@azdagron azdagron removed the triage/in-progress Issue triage is in progress label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/backlog Issue is approved and in the backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants