-
Notifications
You must be signed in to change notification settings - Fork 76
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
Expose a function from sigs.k8s.io/yaml that allows for strict unmarshaling to distinguish between strict and nonstrict errors. #70
Comments
cc @liggitt |
For full parity with the strict json parser, we'd need:
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. 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. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". 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. |
Currently, the kjson library exposes an
UnmarshalStrict
function that returns strict errors and nonstrict errors separately (strict errors are those relating to unknown fields that are only erroneous when strict unmarshaling is desired and still allow marshaling to occur, while nonstrict errors are any other errors that are always fatal to the marshaling).We want to expose a similar function from kyaml (sigs.k8s.io/yaml) so that the strict unmarshaling that occurs higher up in the stack does not need to unmarshaling does not need to be performed twice.
For example in the applyPatcher of the patch handler, when we want to perform a strict unmarshal, we first do a regular
Unmarshal
, confirm that there are no errors, and then perform a secondStrictUnmarshal
to check for any additional errors that must be strict errors.A better approach is to just do a single
UnmarshalStrict
and check the non-strict errors to return fatally (if non-nil) like how we do for kjson.The text was updated successfully, but these errors were encountered: