-
Notifications
You must be signed in to change notification settings - Fork 611
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
feat: add variables field to the v1beta3 eventtype spec #8445
base: main
Are you sure you want to change the base?
Conversation
Welcome @Ahmed-Labs! It looks like this is your first PR to knative/eventing 🎉 |
Hi @Ahmed-Labs. Thanks for your PR. I'm waiting for a knative 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. |
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.
Awesome start @Ahmed-Labs, thanks for working on this!
I left a few comments, and then I think this will be good to merge
/ok-to-test |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8445 +/- ##
==========================================
+ Coverage 64.10% 64.16% +0.06%
==========================================
Files 388 388
Lines 23363 23405 +42
==========================================
+ Hits 14976 15018 +42
Misses 7591 7591
Partials 796 796 ☔ View full report in Codecov by Sentry. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ahmed-Labs 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 |
/ok-to-test |
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.
@Ahmed-Labs can you fix the format errors?
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.
// Variables is an array that provides definitions for variables used within attribute values. | ||
// +optional | ||
Variables []EventVariableDefinition `json:"variables,omitempty"` |
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.
We need to ensure that every EventType version can be converted to and from v1beta3, so we need to add these new fields (and type) to every other served version (v1beta2 and v1beta1), otherwise the new fields will be dropped as the objects are stored using v1beta2:
eventing/config/core/resources/eventtype.yaml
Lines 171 to 173 in 71b4b68
- name: v1beta2 | |
served: true | |
storage: true |
Also we would need to update the validation functions for other versions too as it's done in the PR for v1beta3, so perhaps, we can extract common logic (like extract variables, etc) to a common file like ./pkg/apis/eventing/eventtype_validation_common.go
Once we've added the fields, types and validations to other versions, we need to update the conversion functions (for v1beta1 and v1beta2) like this one to set such new fields
}, { | ||
name: "invalid eventtype due to missing variable definitions", | ||
ets: &EventTypeSpec{ |
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.
Would this be a valid and interesting case to test as well? test.{test\\{Variable}.{defined\\}Variable}
Thanks @Ahmed-Labs, I left a review |
Fixes #7729
Proposed Changes
Pre-review Checklist