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

Use sigs.k8s.io/yaml rather than pkg.in/yaml.v2. #1438

Merged
merged 4 commits into from
Mar 25, 2020
Merged

Use sigs.k8s.io/yaml rather than pkg.in/yaml.v2. #1438

merged 4 commits into from
Mar 25, 2020

Conversation

porridge
Copy link
Member

@porridge porridge commented Mar 25, 2020

What this PR does / why we need it:

Turns out that yaml.v2 unmarshals maps into map[interface{}]interface{} rather
than try to insist on a most narrow possible key type (i.e. string). Such values
are then rejected by sigs.k8s.io/yaml.Marshal that WrapParamValue uses,
because it does a conversion to JSON first, and JSON does not support
non-string keys.

It seems like yaml.v3 works better in that regard. However comments on the
aforementioned issue seem to imply that it's still not all rosy.

Moreover, using the same package for unmarshalling as we do for marshalling
seems like a more stable choice long-term.

This also adds some vlog statements and tidies up go.mod.

Fixes #1437
Fixes #1463

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@zen-dog
Copy link
Contributor

zen-dog commented Mar 25, 2020

Also, I'd like to see a test for the #1437

Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. A unit test for this would be good, apart from that lgtm.

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
@porridge
Copy link
Member Author

Thanks for the quick reviews. Test added.

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 nice work! lgtm

@kensipe kensipe merged commit 9515d86 into master Mar 25, 2020
@kensipe kensipe deleted the bug-1437 branch March 25, 2020 20:45
@porridge porridge added the release/highlight This PR is a highlight for the next release label Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/highlight This PR is a highlight for the next release
Projects
None yet
5 participants