Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .syft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select-catalogers:
- -github-actions-usage-cataloger
17 changes: 9 additions & 8 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# The OWNERS file is used by prow to automatically merge approved PRs.

# DO NOT EDIT! File generated via https://github.com/openshift-knative/hack/tree/main/config.

approvers:
- technical-oversight-committee
- knative-release-leads
- client-writers
- func-writers
- functions-wg-leads
- creydr
- dsimansk
- gauron99
- lkingland
- matejvasek
- rudyredhat1

reviewers:
- client-writers
- func-reviewers

- jrangelramos
1 change: 1 addition & 0 deletions ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sun Jan 11 20:02:54 EST 2026
25 changes: 23 additions & 2 deletions cmd/func-util/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"flag"
"fmt"
"log"
"os"
"os/signal"
"path/filepath"
Expand Down Expand Up @@ -73,7 +74,11 @@ func socat(ctx context.Context) error {
return cmd.Execute()
}

const middlewareFileName = "middleware-version"

func scaffold(ctx context.Context) error {
logger := log.New(os.Stderr, "scaffold:", log.LstdFlags)
logger.Printf("args: %#v", os.Args)

if len(os.Args) != 2 {
return fmt.Errorf("expected exactly one positional argument (function project path)")
Expand All @@ -96,7 +101,9 @@ func scaffold(ctx context.Context) error {
return fmt.Errorf("cannot get middleware version: %w", err)
}

if err := os.WriteFile("/tekton/results/middlewareVersion", []byte(middlewareVersion), 0644); err != nil {
logger.Println("middleware:", middlewareVersion)

if err := os.WriteFile("middleware-version", []byte(middlewareVersion), 0644); err != nil {
return fmt.Errorf("cannot write middleware version as a result: %w", err)
}

Expand Down Expand Up @@ -141,7 +148,12 @@ func s2iCmd(ctx context.Context) error {
return cmd.Execute()
}

const imageDigestFileName = "image-digest"

func deploy(ctx context.Context) error {
logger := log.New(os.Stderr, "deploy:", log.LstdFlags)
logger.Printf("args: %#v", os.Args)

var err error
deployer := knative.NewDeployer(
knative.WithDeployerVerbose(true),
Expand All @@ -161,13 +173,22 @@ func deploy(ctx context.Context) error {
if err != nil {
return fmt.Errorf("cannot load function: %w", err)
}

var digestPart string
d, err := os.ReadFile(imageDigestFileName)
if err == nil {
digestPart = "@" + string(d)
}

if len(os.Args) > 2 {
f.Deploy.Image = os.Args[2]
f.Deploy.Image = os.Args[2] + digestPart
}
if f.Deploy.Image == "" {
f.Deploy.Image = f.Image
}

logger.Printf("fn: %#v", f)

res, err := deployer.Deploy(ctx, f)
if err != nil {
return fmt.Errorf("cannot deploy the function: %w", err)
Expand Down
12 changes: 12 additions & 0 deletions cmd/func-util/s2i_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main
import (
"context"
"fmt"
"log"
"net/url"
"os"
"path/filepath"
Expand Down Expand Up @@ -46,6 +47,17 @@ func newS2IGenerateCmd() *cobra.Command {
genCmd := &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
config.envVars = args

if config.middlewareVersion == "" {
bs, err := os.ReadFile(middlewareFileName)
if err != nil {
return fmt.Errorf("cannot read middleware file: %w", err)
}
config.middlewareVersion = string(bs)
}

logger := log.New(os.Stderr, "s2i-gen:", log.LstdFlags)
logger.Printf("config: %+v\n", config)
return runS2IGenerate(cmd.Context(), config)
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tkn_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Installation: func tkn-tasks | kubectl apply -f -
`,
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
_, err := fmt.Fprintln(cmd.OutOrStdout(), tekton.GetClusterTasks())
_, err := fmt.Fprintln(cmd.OutOrStdout(), tekton.GetClusterTasks()+"\n---\n"+tekton.GetDevConsolePipelines())
return err
},
}
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func build
```
--base-image string Override the base image for your function (host builder only)
--build-timestamp Use the actual time as the created time for the docker image. This is only useful for buildpacks builder.
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". ($FUNC_BUILDER) (default "pack")
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". ($FUNC_BUILDER) (default "s2i")
--builder-image string Specify a custom builder image for use by the builder other than its default. ($FUNC_BUILDER_IMAGE)
-c, --confirm Prompt to confirm options interactively ($FUNC_CONFIRM)
-h, --help help for build
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_config_git_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func config git set
### Options

```
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "pack")
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "s2i")
--builder-image string Specify a custom builder image for use by the builder other than its default. ($FUNC_BUILDER_IMAGE)
--config-cluster Configure cluster resources (credentials and config on the cluster).
--config-local Configure local resources (pipeline templates).
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func deploy
--base-image string Override the base image for your function (host builder only)
--build string[="true"] Build the function. [auto|true|false]. ($FUNC_BUILD) (default "auto")
--build-timestamp Use the actual time as the created time for the docker image. This is only useful for buildpacks builder.
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "pack")
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "s2i")
--builder-image string Specify a custom builder image for use by the builder other than its default. ($FUNC_BUILDER_IMAGE)
-c, --confirm Prompt to confirm options interactively ($FUNC_CONFIRM)
--deployer string Type of deployment to use: 'knative' for Knative Service (default) or 'raw' for Kubernetes Deployment ($FUNC_DEPLOY_TYPE)
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/func_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func run
--address string Interface and port on which to bind and listen. Default is 127.0.0.1:8080, or an available port if 8080 is not available. ($FUNC_ADDRESS)
--base-image string Override the base image for your function (host builder only)
--build string[="true"] Build the function. [auto|true|false]. ($FUNC_BUILD) (default "auto")
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "pack")
-b, --builder string Builder to use when creating the function's container. Currently supported builders are "host", "pack" and "s2i". (default "s2i")
--builder-image string Specify a custom builder image for use by the builder other than its default. ($FUNC_BUILDER_IMAGE)
-c, --confirm Prompt to confirm options interactively ($FUNC_CONFIRM)
-e, --env stringArray Environment variable to set in the form NAME=VALUE. You may provide this flag multiple times for setting multiple environment variables. To unset, specify the environment variable name followed by a "-" (e.g., NAME-).
Expand Down
Loading
Loading