3

I'm trying to assign the output of a function to a var and append to the string at the same time but can't figure out the right syntax.

None of these examples work:

{{- $myvar := include "mychart.helper" . "-myprefix" -}}
{{- $myvar := {{include "mychart.helper" .}} "-myprefix" -}}
{{- $myvar := (include "mychart.helper" .) "-myprefix" -}}
halfer
  • 19,824
  • 17
  • 99
  • 186
red888
  • 27,709
  • 55
  • 204
  • 392

1 Answers1

3

It seems the right way to do this is to use the print() function

{{- $myvar := print (include "mychart.helper" .) "-myprefix" -}}
red888
  • 27,709
  • 55
  • 204
  • 392