Add URI validation for EventType Source and Schema fields#8837
Add URI validation for EventType Source and Schema fields#8837Kunal1522 wants to merge 1 commit intoknative:mainfrom
Conversation
|
Hi @Kunal1522. Thanks for your PR. I'm waiting for a github.com 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. DetailsInstructions 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: Kunal1522 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/ok-to-test |
Changes
Fixes #8836
This PR addresses the TODO comments in eventtype_validation.go by adding validation for the
SourceandSchemaURI fields in EventTypeSpec.Before: An EventType could be created with empty Source/Schema URIs (e.g.,
"source": ""), which would parse successfully but result in a meaningless empty URI.After: If
SourceorSchemais provided (non-nil) but empty, validation will reject it with a clear error message.What type of PR is this?
/kind cleanup
What this PR does
EventTypeSpec.Validate()to check thatSourceandSchemafields are not empty when providedWhich issue(s) this PR fixes
Fixes the following TODOs in the codebase:
// TODO validate Source is a valid URI.// TODO validate Schema is a valid URI.How was this tested?
go test -v ./pkg/apis/eventing/v1beta1/... -run TestEventType