-
Notifications
You must be signed in to change notification settings - Fork 480
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 functions (sprig) #5575
Comments
We gave it some discussion. The consensus was that many of these functions seem super useful but a few seem undesirable. In order to pick this up, someone needs to go through that list and make a proposal of functions we'd like to include in the first pass. |
Would be happy to inventory the functions, but not being part of the discussion, am not privy to the thinking behind what might be undesirable. Could you please give some guidance on what that might be? Alternately, we could start with just the string functions and skip the rest for now? |
Concerns were mostly around usefulness and some small safety concerns. I think taking only the immediately useful functions on the first pass is appropriate. Others can be added if a strong case can be made. Things that seem immediately useful:
Most of the advanced functions seem weird to include. Same with the math, time, and int/float functions. |
Took a really rough stab at making a list. |
Fixes: spiffe#5575 Signed-off-by: Kevin Fox <[email protected]>
The embeded go template engine does not have many useful functions built in.
Other tools such as helm and step-ca embed a library named sprig (https://masterminds.github.io/sprig/)
In particular, some of the string functions are extremely useful. (contains, hasPrefix, trimPrefix, cat, replace, ...)
It would be very easy to embed the library and make it available for use in templates.
Alternately, it would be possible to embed the library and cherry pick only the functions we want to make available to our templates if there is concern there is too many functions there.
The text was updated successfully, but these errors were encountered: