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

Bug: using yaml.v2 for deserialization may lead to failure in json serialization #940

Closed
liu-hm19 opened this issue Mar 19, 2024 · 0 comments · Fixed by #956
Closed

Bug: using yaml.v2 for deserialization may lead to failure in json serialization #940

liu-hm19 opened this issue Mar 19, 2024 · 0 comments · Fixed by #956
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@liu-hm19
Copy link
Contributor

What happened?

Since the Env in Container of the Workload is the type of MapSlice, which only exists in yaml.v2 package, currently we use yaml.v2 for unmarshaling module resources. But it does not support the nested map[string]interface{}, resulting it become map[interface{}]interface{}, which may easily cause the subsequent JSON marshaling to fail because JSON keys can only be the type of string.

Here is a related discussion on GitHub: go-yaml/yaml#139

image

What did you expect to happen?

Please unify the usage of yaml.v2 & yaml.v3. For me, better to use yaml.v3.

How can we reproduce it (as minimally and precisely as possible)?

Execute kusion build, kusion preview, kusion apply or kusion destroy on Kusion module with nested map[string]interface{} config.

Anything else we need to know?

No response

Kusion version

$ kusion version
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants