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
fromJson (toJson .Chart) does not have reflexive behavior #12990
Comments
I know it was weird of me to |
@SOF3 do you have a complete, but minimal example which I can look at and test the failure scenario? It's a bit unclear (to me) what is happening here. |
$ cat templates/example.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: abc
data:
release: {{include "show-keys" (toJson .Release) | toJson}}
chart: {{include "show-keys" (toJson .Chart) | toJson}}
{{- define "show-keys" -}}
{{keys (fromJson .)}}
{{- end}}
$ helm template .
---
# Source: demo/templates/example.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: abc
data:
release: "[Revision Service IsInstall IsUpgrade Name Namespace]"
chart: "[version description apiVersion appVersion type IsRoot name]" |
Output of
helm version
:When I evaluate
.Chart.Name
, it goes through the Go exported field. But when I evaluate(fromJson (toJson .Chart)).Name
, it becomes null, becausetoJson
emitsName
as the aliasname
instead, andfromJson
would not unmarshal it back to the tagged struct and I have to write.name
instead of.Name
.The text was updated successfully, but these errors were encountered: