GeezerVison is showing github.com — fix: forward CLI overrides to in-cluster deploy for Git-based remote deploys by Ankitsinghsisodya · Pull Request #3777 · knative/func
Conversation
Fixes #3768
Problem
When func deploy uses a Git-based pipeline (f.Build.Git.URL is set), CLI flags like --image-pull-secret, --service-account, and --deployer are silently ignored. The on-cluster func-deploy task step reads func.yaml directly from the cloned Git repo, which never contains in-memory CLI overrides — unlike the PVC-upload path fixed by #3663.
Solution
Forward the three CLI overrides as discrete Tekton params on the pipeline run and apply them as environment variables on the func-deploy task step. The in-cluster deploy binary reads these env vars and applies them over the values loaded from func.yaml.
How it works
func deploy --image-pull-secret my-secret --deployer raw
→ templateData.ImagePullSecret / Deployer populated
→ PipelineRun param: imagePullSecret=my-secret, deployer=raw
→ Pipeline threads params to Task: IMAGE_PULL_SECRET, DEPLOYER
→ func-deploy step env: FUNC_IMAGE_PULL_SECRET, FUNC_DEPLOYER
→ deploy binary: os.Getenv overrides f loaded from committed func.yaml
The env vars are only applied when non-empty, so existing behaviour is unchanged when no overrides are passed.
Changes
cmd/func-util/main.go — read FUNC_IMAGE_PULL_SECRET, FUNC_SERVICE_ACCOUNT, FUNC_DEPLOYER env vars after loading func.yaml and apply them over the struct before deploying
task-buildpack.yaml.tmpl / task-s2i.yaml.tmpl — add IMAGE_PULL_SECRET, SERVICE_ACCOUNT, DEPLOYER params; set corresponding FUNC_* env vars on the func-deploy step
templates_pack.go / templates_s2i.go — add the three params to the Pipeline spec and thread them to the task; add them to the PipelineRun params
templates.go — add ImagePullSecret, ServiceAccountName, Deployer to templateData; populate from f.Deploy.* in createAndApplyPipelineRunTemplate
Notes
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This commit enhances the deployment process by allowing CLI-specified overrides for image pull secrets, service accounts, and deployer types to be forwarded to the in-cluster deployment step. The changes include:
- Updated `main.go` to read environment variables for `FUNC_IMAGE_PULL_SECRET`, `FUNC_SERVICE_ACCOUNT`, and `FUNC_DEPLOYER`.
- Modified Tekton task templates (`task-buildpack.yaml.tmpl`, `task-s2i.yaml.tmpl`) to include new parameters for these overrides.
- Adjusted template data structures in `templates_pack.go` and `templates_s2i.go` to accommodate the new parameters.
These enhancements ensure that user-defined configurations are properly applied during deployment, improving flexibility and usability.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Ankitsinghsisodya
Once this PR has been reviewed and has the lgtm label, please assign matzew for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found 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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi @Ankitsinghsisodya. Thanks for your PR.
I'm waiting for a knative 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.
Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
May 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.98%. Comparing base (584c11e) to head (99e41fc).
⚠️ Report is 88 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3777 +/- ##
==========================================
- Coverage 57.03% 54.98% -2.05%
==========================================
Files 182 200 +18
Lines 21376 24514 +3138
==========================================
+ Hits 12191 13479 +1288
- Misses 7953 9761 +1808
- Partials 1232 1274 +42
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
dsimansk
Awaiting requested review from dsimansk
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
ok-to-test
🤖 Non-member PR verified by an org member that is safe to test.
size/L
🤖 PR changes 100-499 lines, ignoring generated files.
Milestone
No milestone
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.
|