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

Allow whitespace in templates #4286

Closed
idsvandermolen opened this issue Oct 15, 2020 · 6 comments
Closed

Allow whitespace in templates #4286

idsvandermolen opened this issue Oct 15, 2020 · 6 comments
Labels
type/feature Feature request

Comments

@idsvandermolen
Copy link
Contributor

Summary

Currently Argo does not allow white space in templating, rendering of {{workflow.parameters.variable}} does correctly work, however {{ workflow.parameters.variable }} doesn't render the variable. Also argo lint did not issue any warning or error.

Use Cases

I often find it more readable when you can add whitespace to separate markers like {{ and }} from variable names.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@idsvandermolen idsvandermolen added the type/feature Feature request label Oct 15, 2020
@alexec
Copy link
Contributor

alexec commented Oct 15, 2020

Good idea. Would you like to investigate how to fix this?

@idsvandermolen
Copy link
Contributor Author

I'm not that proficient in Go, but looks like in function Replace this https://github.com/argoproj/argo/blob/8facaceeb3515d804c3fd276b1802dbd6cf773e8/workflow/common/util.go#L375
could probably be replaced with:

  replacement, ok := replaceMap[strings.TrimSpace(tag)]

@alexec
Copy link
Contributor

alexec commented Oct 16, 2020

Want to submit a PR?

@idsvandermolen
Copy link
Contributor Author

👍 let me have a look

@idsvandermolen
Copy link
Contributor Author

There you go, PR #4310

@idsvandermolen
Copy link
Contributor Author

btw I had to make a few Makefile adjustments to be able to build (see PR #4311)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants