Created
March 1, 2025 05:10
-
-
Save shivanshs9/2922455353868eef0ed4c846aa20c5e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* | |
Because of Helm bug (https://github.com/helm/helm/issues/3001), Helm converts | |
int value to float64 implictly, like 2748336 becomes 2.748336e+06. | |
This breaks the output even when using quote to render. | |
Use this function when you want to get the string value only. | |
It handles the case when the value is string itself as well. | |
Parameters: is string/number | |
*/}} | |
{{- define "stringOrNumber" -}} | |
{{- if kindIs "string" . }} | |
{{- print . -}} | |
{{- else }} | |
{{- int64 . | toString -}} | |
{{- end -}} | |
{{- end -}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment