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

Helm always parses YAML integers as Golang float64 #13023

Closed
chowder opened this issue May 9, 2024 · 1 comment
Closed

Helm always parses YAML integers as Golang float64 #13023

chowder opened this issue May 9, 2024 · 1 comment

Comments

@chowder
Copy link

chowder commented May 9, 2024

Is there any way to coerce YAML integer values to show up as int64 values with type functions (e.g. typeIs)?

Interestingly using --set from the command-line yields a different result.

$ cat values.yaml
foo:1

$ cat templates/foo.yaml --plain
value: {{ .Values.foo }}
type: {{ typeOf .Values.foo }}

$ helm template . --show-only templates/foo.yaml
---
# Source: my-chart/templates/foo.yaml
value: 1
type: float64

$ helm template . --show-only templates/foo.yaml --set foo=1
---
# Source: my-chart/templates/foo.yaml
value: 1
type: int64

Output of helm version: version.BuildInfo{Version:"v3.14.4", GitCommit:"81c902a123462fd4052bc5e9aa9c513c4c8fc142", GitTreeState:"clean", GoVersion:"go1.21.9"}

Output of kubectl version: N/A

Cloud Provider/Platform (AKS, GKE, Minikube etc.): N/A

@gjenkins8
Copy link
Contributor

#9362
#11130 (comment)

If you want a particular format for a value, you're best to explicitly type that e.g.: {{ .Values.foo | int64 }}

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

No branches or pull requests

2 participants