GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: persistent deployer in func.yaml, block incompatible deployer switch, func delete removes f.Deploy values to match reality by gauron99 · Pull Request #3953 · knative/func

Conversation

@gauron99

@gauron99 gauron99 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

global deployer

  • make deployer as a globally configurable -- mirror builder -> its now always persisted in func.yaml
  • this makes it so its easier to work with deployers.X value instead of hardcoded values
  • for backwards compat if we hit deployer == "" (as it was before) we default to Knative as that was the default all along
  • note: I wouldnt be opposed to removing the "backwards compat" the only time you hit this is you deployed function with older binary, then you fetch new binary and try to "redeploy" again... its adding extra machinery which is ugly 😄 but I suppose it is the "standard upgrade path"

deployer switch

  • second part is blocking switch re-deploy early -- we now have 3 distinct deployers of which most dont share resources.
  • we dont want to make deployers aware of other deployers resources therefore stop this early.
  • the only documented compatible switch right now is raw -> keda because keda deployer embeds the raw deployer -- eg same resources.

func delete change

  • on successful undeploy -- func delete now actually removes the f.Deploy.Namespace and f.Deploy.Deployer values so that func.yaml correctly represents the state of the function on cluster (only when deleting by project! not name since theres no local files for that flow)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos July 17, 2026 15:16
@gauron99
gauron99 requested review from Copilot and lkingland and removed request for Copilot, dsimansk and jrangelramos July 17, 2026 15:16
@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/XL 🤖 PR changes 500-999 lines, ignoring generated files. labels Jul 17, 2026
@gauron99
gauron99 requested review from Copilot and matejvasek July 17, 2026 15:16
Copilot started reviewing on behalf of gauron99 July 17, 2026 15:16
View session
@gauron99
gauron99 force-pushed the push-oymlnoorklvq branch from 91da09f to 88f644d Compare July 17, 2026 15:21
Copilot AI reviewed Jul 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR makes deployer selection a first-class, globally configurable setting that is persisted into func.yaml, adds a safety guard to prevent redeploying an already-deployed function with an incompatible deployer (to avoid orphaning resources), and updates delete-by-project to clear deployed markers from local state after a successful undeploy.

Changes:

  • Introduce canonical deployer names (pkg/deployers) and use them across deployer implementations and config defaults.
  • Persist deployer into func.yaml via global config/application and block incompatible deployer switches on redeploy (except raw -> keda).
  • Improve raw deployer trigger-sync behavior to tolerate forbidden trigger RBAC only when no subscriptions are declared; update docs/tests and clear deploy markers on successful project delete.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/knative/deployer.go Switch knative deployer name constant to canonical deployers package.
pkg/keda/deployer.go Switch keda deployer name constant to canonical deployers package.
pkg/k8s/deployer.go Use canonical raw deployer name; add forbidden-tolerant trigger-sync choke point.
pkg/k8s/triggers_test.go Add unit tests covering forbidden trigger-sync behavior and warnings.
pkg/deployers/deployers.go New package defining canonical deployer names + default.
pkg/config/config.go Add global Deployer field/default and apply/configure propagation to functions.
pkg/config/config_test.go Ensure global config key listing includes deployer.
cmd/deploy.go Add globally configurable --deployer flag defaulting chain + guard against incompatible redeploy deployer switches.
cmd/deploy_test.go Add tests for deployer persistence, global seeding, and switch-guard behavior.
cmd/delete.go After successful delete-by-project, clear deployed markers and write updated func.yaml.
cmd/delete_test.go Add tests verifying deployed markers are cleared only for delete-by-project.
docs/reference/func_deploy.md Update deploy help text to reflect deployer behavior/default.
docs/reference/func_delete.md Document that delete-by-project updates local func.yaml on success.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/delete.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/deploy.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/reference/func_deploy.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gauron99
gauron99 force-pushed the push-oymlnoorklvq branch from 88f644d to 7430589 Compare July 17, 2026 15:31
@gauron99
gauron99 requested a review from Copilot July 17, 2026 15:31
Copilot started reviewing on behalf of gauron99 July 17, 2026 15:31
View session
Copilot AI reviewed Jul 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/deploy.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/deploy.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Jul 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.36%. Comparing base (2797984) to head (f844198).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/deployer/testing/integration_test_helper.go 0.00% 8 Missing ⚠️
pkg/mock/deployer.go 0.00% 8 Missing ⚠️
pkg/config/config.go 50.00% 4 Missing and 1 partial ⚠️
pkg/pipelines/tekton/pipelines_provider.go 44.44% 5 Missing ⚠️
cmd/delete.go 66.66% 2 Missing and 1 partial ⚠️
pkg/functions/client.go 89.47% 2 Missing ⚠️
pkg/remover/testing/integration_test_helper.go 0.00% 2 Missing ⚠️
cmd/deploy.go 90.90% 1 Missing ⚠️
pkg/describer/testing/integration_test_helper.go 0.00% 1 Missing ⚠️
pkg/lister/testing/integration_test_helper.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3953      +/-   ##
==========================================
+ Coverage   54.26%   54.36%   +0.10%     
==========================================
  Files         203      204       +1     
  Lines       23915    23974      +59     
==========================================
+ Hits        12977    13033      +56     
+ Misses       9697     9696       -1     
- Partials     1241     1245       +4     
Flag Coverage Δ
e2e 34.09% <48.57%> (+<0.01%) ⬆️
e2e go 29.18% <22.00%> (-0.04%) ⬇️
e2e node 25.50% <22.00%> (-0.04%) ⬇️
e2e python 29.50% <22.00%> (-0.04%) ⬇️
e2e quarkus 25.62% <22.00%> (-0.04%) ⬇️
e2e rust 25.01% <22.00%> (-0.09%) ⬇️
e2e springboot 23.77% <22.00%> (-0.03%) ⬇️
e2e typescript 25.61% <22.00%> (-0.04%) ⬇️
e2e-config-ci 26.75% <18.00%> (-0.05%) ⬇️
integration 15.67% <24.24%> (+0.03%) ⬆️
unit macos-14 43.79% <46.96%> (+0.14%) ⬆️
unit macos-latest 43.79% <46.96%> (+0.14%) ⬆️
unit ubuntu-24.04-arm 44.06% <46.66%> (+0.13%) ⬆️
unit ubuntu-latest 44.64% <46.96%> (+0.14%) ⬆️
unit windows-latest 43.83% <46.96%> (+0.13%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99 gauron99 changed the title feat: persistent deployer in func.yaml + block incompatible deployer switch re-deploy feat: persistent deployer in func.yaml, block incompatible deployer switch, func delete removes f.Deploy values to match reality Jul 20, 2026
lkingland
lkingland reviewed Jul 20, 2026
View reviewed changes

@lkingland lkingland left a comment

Copy link
Copy Markdown
Member

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.

Nice! My only suggestion is to move most of that logic into core from the CLI pkg

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/delete.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/delete_test.go
// path-based delete clears both Deploy.Namespace and Deploy.Deployer -
// live-deployment state that's stale once undeployed. The next flagless
// deploy correctly falls back to the global config's deployer default.
func TestDelete_ByProjectClearsDeployedMarker(t *testing.T) {

@lkingland lkingland Jul 20, 2026

Copy link
Copy Markdown
Member

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.

Likewise, this could be a test in core, because it would be doing this clearing for every deployer (even the mock on the test)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/delete_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/delete_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/deploy.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread cmd/deploy_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/config/config.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

to resolve the tension between unclear boundaries of func.yaml purpose in terms of "half status/ half declared intention" we introduced different means to interpret some keys. usually having one yaml key represent both is fine but sometimes its not. Sometime the current state is a dependency for some action.

Knowing if a function was deployed is essential to deliver "was the deployer changed". We can determine if function was deployed by checking the f.Depoy.Namespace because we intentionally created 2 keys for this (the other f.Namespace`) Now we need to introduce the same for deployer because the difference between intent and current state requires it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99
gauron99 force-pushed the push-oymlnoorklvq branch 2 times, most recently from 02b00b7 to 446963e Compare July 23, 2026 14:02
@gauron99
gauron99 requested a review from Copilot July 23, 2026 16:45
Copilot started reviewing on behalf of gauron99 July 23, 2026 16:46
View session
Copilot AI reviewed Jul 23, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread cmd/deploy.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/functions/client.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gauron99
fix: persist effective deployer in func.yaml; block deployer switch e…
f844198
…xcept raw->keda
@gauron99
gauron99 force-pushed the push-oymlnoorklvq branch from 446963e to f844198 Compare July 23, 2026 20:18
@gauron99
gauron99 requested a review from Copilot July 23, 2026 20:48
Copilot started reviewing on behalf of gauron99 July 23, 2026 20:49
View session
Copilot AI reviewed Jul 23, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/functions/client.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/functions/client.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

lkingland
lkingland approved these changes Jul 24, 2026
View reviewed changes

@lkingland lkingland left a comment

Copy link
Copy Markdown
Member

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.

🎉

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow knative-prow Bot assigned lkingland Jul 24, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Jul 24, 2026
@knative-prow

knative-prow Bot commented Jul 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, lkingland

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:
  • OWNERS [gauron99,lkingland]

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow
knative-prow Bot merged commit 6502964 into knative:main Jul 24, 2026
44 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@aliok aliok mentioned this pull request Sep 17, 2026
Legacy deploy.deployer-only functions lose deployer intent on func delete then func deploy #4054
Closed
Elvand-Lie added a commit to Elvand-Lie/func that referenced this pull request Oct 9, 2026
@Elvand-Lie
fix(migrations): recover legacy deployer intent at 0.39.0
d323e3d
A pre-knative#3953 func.yaml recorded the deployer only under deploy.deployer.
Deleting such a function clears the observed Deploy.Deployer, and with
intent f.Deployer never populated the next deploy fell back to the
default knative deployer via config.Apply. Promote the legacy observed
value to top-level intent (explicit intent always wins); observed state
is preserved.

Fixes knative#4054

Signed-off-by: Elvand Lie Nababan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@lkingland lkingland lkingland approved these changes
@matejvasek matejvasek Awaiting requested review from matejvasek

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lkingland lkingland

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@gauron99 @lkingland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.