fix(deploy): don't write func.yaml before remote pipeline runs (#3679)#3779
fix(deploy): don't write func.yaml before remote pipeline runs (#3679)#3779Sofiyan-Shaikh wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sofiyan-Shaikh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
|
Welcome @Sofiyan-Shaikh! It looks like this is your first PR to knative/func 🎉 |
|
Hi @Sofiyan-Shaikh. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
|
Thanks @Sofiyan-Shaikh! This implements Solution B from the #3679 body — exactly what we hoped for. Heads up: the CLA bot is flagging that the CLA isn't signed yet. Please sign it via the link in the bot's comment above so CI can run. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3779 +/- ##
==========================================
+ Coverage 56.90% 57.09% +0.18%
==========================================
Files 181 182 +1
Lines 20933 21418 +485
==========================================
+ Hits 11912 12228 +316
- Misses 7811 7954 +143
- Partials 1210 1236 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changes
func deploy --remotedirtying the working tree by writingfunc.yamlto disk before the pipeline runs (regression from fix: writefunc.yamlbefore remote deploy upload #3663)Function.MarshalYAMLas the single source of truth forfunc.yamlbytes, shared byWriteand the remote source uploadfunc.yaml(with CLI overrides applied) into the source-upload tar stream instead of pre-writing it to disk; revert the prematuref.Write()incmd/deploy.goThis restores the documented invariant that
func.yamlreflects deployedstate, not last-attempt state. A failed remote deploy no longer leaves the
working tree dirty, so users can retry with different one-off flags (e.g.
--image-pull-secret) without first revertingfunc.yaml. Local and remotedeploys are symmetric again. The #3663 bug fix (CLI flags reaching the
on-cluster deploy step) is preserved — the in-memory function is serialized
into the upload tar stream, so the on-cluster step still sees the latest
config without touching disk until a successful deploy.
Scope is limited to the non-git, direct-PVC-upload path
(
sourcesAsTarStream). The git-path flow is tracked separately in #3768.Tests: reproduction/regression test asserting a failed remote deploy leaves
func.yamlbyte-identical on disk; tar-stream tests covering in-memoryoverride injection (with and without an on-disk
func.yaml) and no diskmutation; rewrote the #3663 test to assert the flag reaches the pipeline
in-memory while disk stays untouched pre-pipeline.
/kind bug
Fixes #3679
Release Note