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

Adds Helm tpl function for rendering templates passed in strings #137

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tpickett
Copy link

@tpickett tpickett commented Nov 5, 2024

Description of your changes

This PR adds the helm tpl function for rendering templates within the templates. See: https://helm.sh/docs/howto/charts_tips_and_tricks/#using-the-tpl-function

Fixes #140

I have:

Signed-off-by: tpickett <[email protected]>
@@ -91,9 +93,35 @@ func setResourceNameAnnotation(name string) string {
return fmt.Sprintf("gotemplating.fn.crossplane.io/composition-resource-name: %s", name)
}

func initInclude(t *template.Template) func(string, interface{}) (string, error) {
func initTpl(parent *template.Template, includedNames map[string]int) func(string, interface{}) (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phisco are you suggesting changes to the function?

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

Successfully merging this pull request may close these issues.

Add tpl function to template rendering
2 participants