Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Remove custom event name validation
Browse files Browse the repository at this point in the history
Allow clients to set custom event names by removing validation expecting
them to content hashes. This help make event PUT|POST more easily
curl-able.

Signed-off-by: Nick Hale <[email protected]>
  • Loading branch information
njhale committed Jul 12, 2023
1 parent f39d170 commit 5a4a090
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
1 change: 0 additions & 1 deletion pkg/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func NewRecorder(c kclient.Client) RecorderFunc {
}

// Set a generated name based on the event content.
// NOTE: This is validated server-side, so it's important that this is done, just before sending the request.
id, err := ContentID(e)
if err != nil {
return fmt.Errorf("failed to generate event name from content: %w", err)
Expand Down
1 change: 0 additions & 1 deletion pkg/server/registry/apigroups/acorn/events/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func NewStorage(c kclient.WithWatch) rest.Storage {

return stores.NewBuilder(c.Scheme(), &apiv1.Event{}).
WithTableConverter(tables.EventConverter).
WithValidateName(new(validator)).
WithCompleteCRUD(strategy).
Build()
}
36 changes: 0 additions & 36 deletions pkg/server/registry/apigroups/acorn/events/validator.go

This file was deleted.

0 comments on commit 5a4a090

Please sign in to comment.