-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
fix 'y' to true when YAML decode to JSON #102445
Conversation
@@ -98,7 +99,7 @@ func (d *YAMLToJSONDecoder) Decode(into interface{}) error { | |||
} | |||
|
|||
if len(bytes) != 0 { | |||
err := yaml.Unmarshal(bytes, into) | |||
err := yaml3.Unmarshal(bytes, into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is necessary to consider as a whole, patch this piece of logic separately and introduce new dependencies. I don't think this is a good modification.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: CaoDonghui123 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@CaoDonghui123: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@fedebongio: GitHub didn't allow me to request PR reviews from the following users: there, a, version, decoder, yaml, since, is, bump, of. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
One does not simply increase the version of the yaml library... 😱 This appears to have broken many unit tests. Ideally we can fix the bug with a much more lightweight tweak. |
|
there's also: #78946 which is a bit broader. |
@@ -98,7 +99,7 @@ func (d *YAMLToJSONDecoder) Decode(into interface{}) error { | |||
} | |||
|
|||
if len(bytes) != 0 { | |||
err := yaml.Unmarshal(bytes, into) | |||
err := yaml3.Unmarshal(bytes, into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigs.k8s.io/yaml
uses json tags in structs for marshaling/unmarshaling, and does mechanical yaml-json conversion
gopkg.in/yaml.v3
expects yaml
struct tags, which none of our API types have, so this switch will not work at all for API types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fundamental issue is #34146. It's unclear if someone will eventually pick it up
@@ -98,7 +99,7 @@ func (d *YAMLToJSONDecoder) Decode(into interface{}) error { | |||
} | |||
|
|||
if len(bytes) != 0 { | |||
err := yaml.Unmarshal(bytes, into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is sigs.k8s.io/yaml
. Kubernetes depends on the features that sigs.k8s.io/yaml
implements on top of go-yaml
. We cannot simply change sigs.k8s.io/yaml
to go-yaml
v3.
Please consider moving forward the go-yaml
v3 conversation in sigs.k8s.io/yaml
. Some background:
- Should this library move to yaml.v3 kubernetes-sigs/yaml#18
- use gopkg.in/laverya/yaml.v3 instead of gopkg.in/yaml.v2 kubernetes-sigs/yaml#26
/close
@roycaihw: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #102308
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: