-
Notifications
You must be signed in to change notification settings - Fork 15
fix: Resolve panic when manifest has an int
#203
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: Resolve panic when manifest has an int
#203
Conversation
/cherry-pick release-2.13 |
@dhaiducek: once the present PR merges, I will cherry-pick it on top of 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-sigs/prow repository. |
/cherry-pick release-2.12 |
@dhaiducek: once the present PR merges, I will cherry-pick it on top of 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-sigs/prow repository. |
/hold there might be a simpler option here... |
6a44dfc
to
caf33c7
Compare
err := yaml.Unmarshal(yamlBytes, &policy.Object) | ||
err := k8syaml.Unmarshal(yamlBytes, &policy.Object) |
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 the key piece. Kubernetes decided int
isn't a safe type, so we need to unmarshal with the Kubernetes YAML parser so it parses to int64
and then we can use the subsequent unstructured
calls. The alternative is the route I started out on to manually do the indexing and type assertions.
ref: https://issues.redhat.com/browse/ACM-18816 Signed-off-by: Dale Haiducek <[email protected]>
caf33c7
to
9d21989
Compare
|
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.
LGTM, thanks for figuring this one out!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, JustinKuli The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
@dhaiducek: #203 failed to apply on top of branch "release-2.13":
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-sigs/prow repository. |
@dhaiducek: #203 failed to apply on top of branch "release-2.12":
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-sigs/prow repository. |
The
unstructured
package made the decision to not supportint
types, but that's exactly what our YAML marshaler uses. Changing to type assertions avoids the panic.ref: https://issues.redhat.com/browse/ACM-18816