Registry Mirror
Skip to content

Conversation

@gauron99

@gauron99 gauron99 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • 🐛 A remote deploy from git (--source or pipelines-as-code) of a never-deployed function with no deployer uses deployers.Default instead of knative.
  • 🐛 A func.yaml with a namespace but no deployer is migrated to deploy.deployer: knative (spec 0.39.0), the deployer it was deployed with.
  • 🐛 func deploy --remote checks for a deployer switch, like a local deploy.

Upstream Default is knative, so this matters for builds with another default, such as openshift/functions (raw).

/kind bug

Testing

go test ./pkg/functions/ ./pkg/deployers/ ./pkg/pipelines/tekton/ ./cmd/
go test -tags exclude_graphdriver_btrfs ./cmd/func-util/

On OpenShift with raw as the default, TestRemote_Dir fails on main with knative deployer failed to get the Knative Service. With this PR the remote, core and expose e2e suites pass (TestRemote_Dir also needs #4168).

  • Tested on OpenShift with raw as the default deployer, as openshift/functions builds it

Release Note

A remote deploy from git (func deploy --remote --source, or pipelines-as-code) uses the default deployer, not always knative, for a function with no deployer. func deploy --remote refuses to switch the deployer func.yaml records. A func.yaml with a namespace but no deployer gets deploy.deployer: knative.

Docs


@knative-prow knative-prow Bot added the kind/bug Bugs label Nov 12, 2026
@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/L 🤖 PR changes 100-499 lines, ignoring generated files. labels Nov 12, 2026
@gauron99 gauron99 mentioned this pull request Nov 12, 2026
2 tasks done
@gauron99
gauron99 requested a balanced review from Copilot November 12, 2026 21:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

@gauron99
gauron99 force-pushed the func-util-default-deployer branch from c8fd446 to 710e7b5 Compare November 13, 2026 00:07
@gauron99
gauron99 requested review from aliok and lkingland and a balanced review from Copilot and removed request for dsimansk and jrangelramos November 13, 2026 00:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

@gauron99

Copy link
Copy Markdown
Contributor Author

/hold

@knative-prow knative-prow Bot added the do-not-merge/hold 🤖 PR should not merge because someone has issued a /hold command. label Nov 13, 2026
@gauron99

Copy link
Copy Markdown
Contributor Author

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.
@gauron99
gauron99 force-pushed the func-util-default-deployer branch from 85f7c37 to 4be4a86 Compare November 16, 2026 10:48
@gauron99
gauron99 requested a max review from Copilot November 16, 2026 10:49
@gauron99

Copy link
Copy Markdown
Contributor Author

/unhold

@knative-prow knative-prow Bot removed the do-not-merge/hold 🤖 PR should not merge because someone has issued a /hold command. label Nov 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The irreversible func.yaml migration and deployer-selection changes require maintainer judgment on historical defaults and CLI/image version skew, plus cluster end-to-end validation.

No open issues 🎉

Review effort: Max

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Nov 16, 2026
@knative-prow

knative-prow Bot commented Nov 16, 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:

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 merged commit ef50ebf into knative:main Nov 16, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/bug Bugs lgtm 🤖 PR is ready to be merged. size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants