Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Working-tree uploads overwrite a legacy function’s implicit Knative deployment history with raw before validation, allowing a Knative-to-raw redeployment that should be rejected.
1 open issue
What changed in this PR
This PR aligns on-cluster deployer selection with local deployment behavior, including builds that use a non-Knative default.
Changes:
- Adds a shared resolver that selects the requested deployer, then the previously used deployer, then the default.
- Applies consistent resolution to remote deployments and scale checks.
- Moves legacy deployment handling into the client and adds resolver and switch-protection tests.
| File | Description |
|---|---|
pkg/pipelines/tekton/pipelines_provider.go |
Records the resolved deployer for remote deployments. |
pkg/functions/function.go |
Resolves the effective deployer for scale validation. |
pkg/functions/function_scale.go |
Uses shared resolution when determining scaler type. |
pkg/functions/client.go |
Treats legacy deployment records as Knative for switch checks. |
pkg/functions/client_test.go |
Tests legacy deployer-switch protection. |
pkg/deployers/deployers.go |
Adds the shared deployer resolver. |
pkg/deployers/deployers_test.go |
Tests deployer resolution precedence. |
cmd/func-util/main.go |
Uses shared resolution and passes the selected deployer as intent. |
cmd/deploy.go |
Removes CLI-only legacy handling and shares Git deployer resolution. |
Review effort: Balanced
c8fd446 to
710e7b5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A critical deployer-selection bug causes working-tree uploads for never-deployed functions to use Knative instead of the configured raw default because the target namespace is assigned before resolving the deployer.
1 open issue
1 resolved since last review
Review effort: Balanced
|
/hold |
|
Im reworking this into a migration. The "legacy fallback" to knative before we had a constant deployer stamp on the func.yaml is adding special cases for the knative fallback. Im going to rework this into a func.yaml migration instead so we can keep the deployment pipeline code cleaner |
710e7b5 to
c490e1b
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The target OpenShift/s2i deployment with raw as the downstream default remains untested against the actual downstream CLI and published func-util image, whose defaults are compiled separately.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
c490e1b to
85f7c37
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The current revision lacks OpenShift/raw-default end-to-end validation with the matching func-util image, leaving deployer selection, spec-0.39 migration, and legacy Knative compatibility unverified.
No open issues 🎉
Review effort: Balanced
func.yaml has recorded the deployer on every deploy since knative-v1.23.0. A function deployed before then without --deployer has a namespace but no deployer: func deployed it with knative, as it did whenever no deployer was given. A new migration (spec 0.39.0) records knative for such a func.yaml when it is loaded. It replaces the CLI's own rule, which only ran for a deploy from a directory: for such a function deployed from git (--source or pipelines-as-code), func-util's switch check saw no deployer and let the function move to another one.
func-util and the pipeline provider pick a function's deployer with the new deployers.Resolve: the one the function asks for, else the one it was deployed with, else deployers.Default. The provider records that deployer and describes the function with the matching describer, and the scale checks use Resolve too. Upstream Default is knative, so a deploy there does not change. A build that sets Default to another deployer now uses it on the cluster too, for a function that names no deployer and was never deployed, such as one deployed with --source from a repository whose func.yaml names none. A function deployed before func.yaml recorded the deployer stays on knative in every build: the migration records knative for it.
client.RunPipeline now runs the deployer and KEDA scaler switch checks that client.Deploy runs, before the pipeline starts. On func deploy --remote from a directory, the provider records the deployer it picks before it uploads func.yaml, so func-util's check compared that deployer with itself and let every switch through.
85f7c37 to
4be4a86
Compare
|
/unhold |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |


Changes
--sourceor pipelines-as-code) of a never-deployed function with no deployer usesdeployers.Defaultinstead of knative.deploy.deployer: knative(spec 0.39.0), the deployer it was deployed with.func deploy --remotechecks for a deployer switch, like a local deploy.Upstream
Defaultis knative, so this matters for builds with another default, such as openshift/functions (raw)./kind bug
Testing
On OpenShift with raw as the default,
TestRemote_Dirfails on main withknative deployer failed to get the Knative Service. With this PR the remote, core and expose e2e suites pass (TestRemote_Diralso needs #4168).Release Note
Docs