-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: add optional strict unmarshalling for LoadFunctionConfig and SimpleProcessor #5926
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
base: master
Are you sure you want to change the base?
feat: add optional strict unmarshalling for LoadFunctionConfig and SimpleProcessor #5926
Conversation
Welcome @lorenzofelletti! |
Hi @lorenzofelletti. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lorenzofelletti 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 |
…pleProcessor - Introduced a new boolean field `Strict` in the SimpleProcessor struct to control strict unmarshalling behavior when loading function configurations. - Updated the LoadFunctionConfig function to accept the `strict` parameter, allowing it to use strict unmarshalling. - Modified SimpleProcessor to be able to control the behaviour - Modified VersionedAPIProcessor, and TemplateProcessor to pass strict false. - Added unit tests for LoadFunctionConfig to cover scenarios for strict mode, including successful loads and failure cases for unknown fields.
5403069
to
fcf54f5
Compare
This PR has multiple commits, and the default merge method is: merge. 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. |
Motivation
When using
SimpleProcessor
one may want to have strict unmarshalling for the function config and throw an error if any unknown field is supplied in the configuration.The current behaviour does not allow this flexibility. Adding strict option to
LoadFunctionConfig
and adding aStrict
field toSimpleProcessor
allows to programmatically change the unmarshalling behaviour, while keeping the current behaviour as the default.Changes
Strict
in the SimpleProcessor struct to control strict unmarshalling behavior when loading function configurations.strict
parameter, allowing it to use strict unmarshalling.