-
Notifications
You must be signed in to change notification settings - Fork 332
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
Use Annotations for common knative validation. #37
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: n3wscott If they are not already assigned, you can assign the PR to them by writing 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 |
Alternates: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/#advanced-topics Heading: Validation We could use OpenAPI to do validation. But I think the downside is it is all or nothing with OpenAPI. |
/hold @n3wscott to make a PR with the same functionality but as an OpenAPI config. |
/hold cancel I think this is still a good idea... /assign @mattmoor |
return true | ||
} | ||
|
||
func (v *K8sQualifiedNameValidator) Validate(fieldName string, value interface{}) (bool, *apis.FieldError) { |
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.
Could Validate
just return err, and absence of error means it's valid?
3c01307
to
459ba22
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: n3wscott If they are not already assigned, you can assign the PR to them by writing 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 |
/test pull-knative-pkg-go-coverage |
The following is the coverage report on pkg/.
|
I am gonna close this now. Learning about annotations in go was interesting but the inability to annotate internal fields from refed objects makes this not useful. |
…tive#37) - Adds PropagateCondition function to simplify lifecycle code - Adds ConditionBuilder for unit tests
Here is the start of me looking at replacing some of the validation we do with annotations.
Please let me know if you like this direction of if I should stop.