-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add validation for results object properties types #5169
Add validation for results object properties types #5169
Conversation
Skipping CI for Draft Pull Request. |
/kind feature |
/hold until #5142 merged |
The following is the coverage report on the affected files.
|
d1335be
to
9c68c3f
Compare
9c68c3f
to
7287408
Compare
/hold cancel |
7287408
to
9d0f9b8
Compare
This commit adds the validation for results object properties types. Right now we only support string types, so if the type is not string we should validate and return err for this.
9d0f9b8
to
c19aa83
Compare
/retest |
1 similar comment
/retest |
// validateObjectResult validates the object result and check if the Properties is missing | ||
// for Properties values it will check if the type is string. |
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.
// validateObjectResult validates the object result and check if the Properties is missing | |
// for Properties values it will check if the type is string. | |
// validateObjectResult validates that the object result has Properties, | |
// and that all Properties are strings. |
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.
Also, is there a reason PropertySpec has a type if the only supported type is string?
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.
yeah it is required in tep75 and I think the reason is to support future extension
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernick 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 |
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
|
||
if len(invalidKeys) != 0 { | ||
return &apis.FieldError{ | ||
Message: fmt.Sprintf("The value type specified for these keys %v is invalid, the type must be string", invalidKeys), |
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.
Message: fmt.Sprintf("The value type specified for these keys %v is invalid, the type must be string", invalidKeys), | |
Message: fmt.Sprintf("The value type specified for these keys %v are invalid, the type must be string", invalidKeys), |
/retest |
2 similar comments
/retest |
/retest |
Changes
This commit adds the validation for results object properties types.
Right now we only support string types, so if the type is not string we
should validate and return err for this.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes