Skip to content

Added func subscribe support to raw deployer#3335

Merged
knative-prow[bot] merged 15 commits intoknative:mainfrom
24aysh:func-subscribe
Jan 26, 2026
Merged

Added func subscribe support to raw deployer#3335
knative-prow[bot] merged 15 commits intoknative:mainfrom
24aysh:func-subscribe

Conversation

@24aysh
Copy link
Contributor

@24aysh 24aysh commented Jan 7, 2026

Changes

🎁 Add new feature - Event subscriptions now work with --deployer raw

Summary

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

Event subscriptions now work with raw Kubernetes deployer (`--deployer raw`). 

Signed-off-by: ayush <ayushkumar2122.ak@gmail.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 7, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@knative-prow
Copy link

knative-prow bot commented Jan 7, 2026

Welcome @24aysh! It looks like this is your first PR to knative/func 🎉

@knative-prow
Copy link

knative-prow bot commented Jan 7, 2026

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 7, 2026
@intojhanurag
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2026
Signed-off-by: ayush <ayushkumar2122.ak@gmail.com>
@matejvasek
Copy link
Contributor

It would be neat to have some tests for this.

@24aysh
Copy link
Contributor Author

24aysh commented Jan 13, 2026

It would be neat to have some tests for this.

sure i'll add them

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 62.60870% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.57%. Comparing base (4f9f7b8) to head (0e28e17).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/k8s/deployer.go 62.60% 34 Missing and 9 partials ⚠️
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     
Flag Coverage Δ
e2e 40.89% <74.72%> (+1.29%) ⬆️
e2e go 35.16% <0.00%> (-0.22%) ⬇️
e2e node 30.97% <0.00%> (-0.20%) ⬇️
e2e python 34.67% <0.00%> (-0.24%) ⬇️
e2e quarkus 31.12% <0.00%> (-0.20%) ⬇️
e2e rust 30.52% <0.00%> (-0.20%) ⬇️
e2e springboot 28.94% <0.00%> (-0.23%) ⬇️
e2e typescript 31.09% <0.00%> (-0.20%) ⬇️
integration 18.61% <15.38%> (-0.02%) ⬇️
unit macos-14 44.51% <13.18%> (-0.18%) ⬇️
unit macos-latest 44.51% <13.18%> (-0.18%) ⬇️
unit ubuntu-24.04-arm 44.64% <13.91%> (-0.18%) ⬇️
unit ubuntu-latest 45.39% <13.18%> (-0.18%) ⬇️
unit windows-latest 44.53% <13.18%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matejvasek
Copy link
Contributor

It would be neat to have some tests for this.

sure i'll add them

btw I think @Kunal1522 works on subscription tests here #3324 maybe you can re-use that.

@24aysh
Copy link
Contributor Author

24aysh commented Jan 14, 2026

It would be neat to have some tests for this.

sure i'll add them

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

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 18, 2026
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2026
@knative-prow knative-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 18, 2026
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2026
@24aysh
Copy link
Contributor Author

24aysh commented Jan 18, 2026

/test unit-tests

@24aysh
Copy link
Contributor Author

24aysh commented Jan 18, 2026

cc @matejvasek
image

@24aysh 24aysh requested a review from intojhanurag January 18, 2026 13:37
@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 21, 2026
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2026
@24aysh
Copy link
Contributor Author

24aysh commented Jan 21, 2026

ready for review @gauron99 @lkingland

@24aysh
Copy link
Contributor Author

24aysh commented Jan 21, 2026

/retest

@24aysh 24aysh requested a review from gauron99 January 21, 2026 20:03
// Delete stale triggers
for _, trigger := range existingTriggers.Items {
// Only delete triggers we manage
if trigger.Annotations[managedByAnnotation] == managedByValue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's a flaw here, i need to update it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this fixed?

Copy link
Contributor Author

@24aysh 24aysh Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did that change that in 660161a

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2026
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2026
@gauron99 gauron99 requested review from lkingland and matejvasek and removed request for dsimansk and jrangelramos January 22, 2026 13:44

for _, sub := range f.Deploy.Subscriptions {
attributes := make(map[string]string)
maps.Copy(attributes, sub.Filters)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need copy? Are there some hidden mutations?

broker := "default"

// Same filters, different order
filters1 := map[string]string{
Copy link
Contributor

@matejvasek matejvasek Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@matejvasek
Copy link
Contributor

/approve
/lgtm
/hold for @gauron99

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 26, 2026
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2026
@matejvasek matejvasek requested a review from gauron99 January 26, 2026 18:25
@knative-prow
Copy link

knative-prow bot commented Jan 26, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2026
@matejvasek
Copy link
Contributor

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 26, 2026
@knative-prow knative-prow bot merged commit 61ed502 into knative:main Jan 26, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add func subscribe support to raw deployer

7 participants