Added func subscribe support to raw deployer#3335
Added func subscribe support to raw deployer#3335knative-prow[bot] merged 15 commits intoknative:mainfrom
Conversation
Signed-off-by: ayush <ayushkumar2122.ak@gmail.com>
|
Welcome @24aysh! It looks like this is your first PR to knative/func 🎉 |
|
Hi @24aysh. 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. |
|
/ok-to-test |
Signed-off-by: ayush <ayushkumar2122.ak@gmail.com>
|
It would be neat to have some tests for this. |
sure i'll add them |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3335 +/- ##
==========================================
+ Coverage 55.47% 55.57% +0.09%
==========================================
Files 173 173
Lines 20112 20225 +113
==========================================
+ Hits 11158 11240 +82
- Misses 7833 7857 +24
- Partials 1121 1128 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
btw I think @Kunal1522 works on subscription tests here #3324 maybe you can re-use that. |
cool, i'll take a look, i will do that within 1-2 days, right now i'm busy with my college stuff |
|
/test unit-tests |
|
cc @matejvasek |
|
ready for review @gauron99 @lkingland |
|
/retest |
| // Delete stale triggers | ||
| for _, trigger := range existingTriggers.Items { | ||
| // Only delete triggers we manage | ||
| if trigger.Annotations[managedByAnnotation] == managedByValue { |
There was a problem hiding this comment.
is there a function name annotation as well here? because if there are 100 functions on cluster, they would all have this managedBy Annotation IIUC? We would be checking multiple functions here and they could have the same trigger name? OR (more probable) we would delete triggers from different functions?
There was a problem hiding this comment.
yeah that's a flaw here, i need to update it
5243ea9 to
660161a
Compare
|
|
||
| for _, sub := range f.Deploy.Subscriptions { | ||
| attributes := make(map[string]string) | ||
| maps.Copy(attributes, sub.Filters) |
There was a problem hiding this comment.
Why do we need copy? Are there some hidden mutations?
| broker := "default" | ||
|
|
||
| // Same filters, different order | ||
| filters1 := map[string]string{ |
There was a problem hiding this comment.
I think his test is all right. Just a note:
Go maps have randomized hashing to avoid DoS on memory. As a result the ordering is random.
Probability you end up with all (key order wise) identical maps is cca 2.78%. So there is 2.78% chance this test will pass even if generateTriggerName() does not internally sort keys.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 24aysh, matejvasek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |

Changes
🎁 Add new feature - Event subscriptions now work with
--deployer rawSummary
This PR implements Knative Trigger creation for the raw Kubernetes deployer
What Changed
Modified File:
pkg/k8s/deployer.go/kind enhancement
Fixes #3272
Release Note