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 — fix: write `func.yaml` before remote deploy upload by creydr · Pull Request #3663 · knative/func

fix: write func.yaml before remote deploy upload #3663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
knative-prow merged 1 commit into knative:main from creydr:fix-remote-deploy-func-yaml-write
May 8, 2026

Uh oh!

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

Merged

fix: write func.yaml before remote deploy upload #3663

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
74bf23a
fix: write func.yaml before remote deploy upload
creydr May 6, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view
fix: write func.yaml before remote deploy upload
Previously, func.yaml was only written to disk after deployment
completed. For remote deploys, the pipeline uploads sources from
disk to a PVC before the on-cluster deploy step runs. This meant
CLI flags like --image-pull-secret, --service-account, or
--deployer were not reflected in the uploaded func.yaml.

Write func.yaml before the pipeline starts so the on-cluster
deploy step sees the latest configuration.
  • Loading branch information

Uh oh!

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

@creydr
creydr committed May 6, 2026
commit 74bf23a1ab54daa81bbdfad64ab66247312686ed

There are no files selected for viewing

6 changes: 6 additions & 0 deletions 6 cmd/deploy.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) {

// Deploy
if cfg.Remote {
// Write func.yaml before the pipeline uploads sources to the PVC,
// so that the on-cluster deploy step sees the latest config
// (e.g. --image-pull-secret, --service-account, --deployer).
Comment thread
Comment on lines +321 to +323

@lkingland lkingland May 8, 2026 •
edited
Loading

Uh oh!

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

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.

Thank you for the explanatory comment.

Creating a follow-up for this becasue we don't write func.yaml until the end for purposes of keeping the source in a clean state, but this gets us over the current hurdle.

Sorry, something went wrong.

Uh oh!

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

All reactions
if err = f.Write(); err != nil {
return
}
var url string
// Invoke a remote build/push/deploy pipeline
// Returned is the function with fields like Registry, f.Deploy.Image &
Expand Down
44 changes: 44 additions & 0 deletions 44 cmd/deploy_test.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,50 @@ func TestDeploy_ImagePullSecretFromEnv(t *testing.T) {
}
}

// TestDeploy_ImagePullSecretRemote ensures that when deploying remotely,
// func.yaml is written to disk before the pipeline starts, so the on-cluster
// deploy step picks up the --image-pull-secret value.
func TestDeploy_ImagePullSecretRemote(t *testing.T) {
root := FromTempDirectory(t)

f := fn.Function{Runtime: "go", Root: root, Registry: TestRegistry}
_, err := fn.New().Init(f)
if err != nil {
t.Fatal(err)
}

pipelinesProvider := mock.NewPipelinesProvider()
pipelinesProvider.RunFn = func(f fn.Function) (string, fn.Function, error) {
// Inside the pipeline Run, func.yaml on disk should already
// have the image pull secret written.
diskFn, err := fn.NewFunction(root)
if err != nil {
t.Fatalf("failed to load func.yaml during pipeline Run: %v", err)
}
if diskFn.Deploy.ImagePullSecret != "my-remote-secret" {
t.Fatalf("expected func.yaml on disk to have imagePullSecret 'my-remote-secret', got '%v'", diskFn.Deploy.ImagePullSecret)
}
f.Deploy.Namespace = "default"
if f.Deploy.Image, err = f.ImageName(); err != nil {
return "", f, err
}
return "", f, nil
}

cmd := NewDeployCmd(NewTestClient(
fn.WithPipelinesProvider(pipelinesProvider),
fn.WithRegistry(TestRegistry),
))
cmd.SetArgs([]string{"--remote", "--image-pull-secret=my-remote-secret", "--namespace=default"})
if err := cmd.Execute(); err != nil {
t.Fatal(err)
}

if !pipelinesProvider.RunInvoked {
t.Fatal("expected pipeline Run to be invoked")
}
}

// Test_ValidateBuilder tests that the builder validation accepts the
// set of known builders, and spot-checks an error is thrown for unknown.
func Test_ValidateBuilder(t *testing.T) {
Expand Down
Loading
Oops, something went wrong.

Uh oh!

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

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.