Skip to content
Open
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 cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"knative.dev/func/pkg/k8s"
"knative.dev/func/pkg/knative"
"knative.dev/func/pkg/oci"
"knative.dev/func/pkg/operator"
"knative.dev/func/pkg/pipelines/tekton"
)

Expand Down Expand Up @@ -82,6 +83,7 @@ func NewClient(cfg ClientConfig, options ...fn.Option) (*fn.Client, func()) {
docker.WithCredentialsProvider(c),
docker.WithTransport(t),
docker.WithVerbose(cfg.Verbose))),
fn.WithSyncer(operator.NewSyncer(operator.WithCredentialsProvider(c))),
}
)

Expand Down
15 changes: 11 additions & 4 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ EXAMPLES
SuggestFor: []string{"delpoy", "deplyo"},
PreRunE: bindEnv("build", "build-timestamp", "builder", "builder-image",
"base-image", "confirm", "domain", "env", "git-branch", "git-dir",
"git-url", "image", "image-pull-secret", "namespace", "path", "platform",
"push", "pvc-size", "service-account", "deployer", "registry",
"registry-insecure", "registry-authfile", "remote", "username", "password",
"token", "verbose", "remote-storage-class"),
"git-url", "image", "image-pull-secret", "management-disabled", "namespace", "path", "platform", "push", "pvc-size",
"service-account", "deployer", "registry", "registry-insecure",
"registry-authfile", "remote", "username", "password", "token", "verbose",
"remote-storage-class"),
RunE: func(cmd *cobra.Command, args []string) error {
return runDeploy(cmd, newClient)
},
Expand Down Expand Up @@ -216,6 +216,8 @@ EXAMPLES
cmd.Flags().StringP("token", "", "",
"Token to use when pushing to the registry. ($FUNC_TOKEN)")
cmd.Flags().BoolP("build-timestamp", "", false, "Use the actual time as the created time for the docker image. This is only useful for buildpacks builder.")
cmd.Flags().Bool("management-disabled", f.Deploy.ManagementDisabled,
"Disable operator management of this function ($FUNC_MANAGEMENT_DISABLED)")
cmd.Flags().StringP("namespace", "n", defaultNamespace(f, false),
"Deploy into a specific namespace. Will use the function's current namespace by default if already deployed, and the currently active context if it can be determined. ($FUNC_NAMESPACE)")

Expand Down Expand Up @@ -555,6 +557,9 @@ type deployConfig struct {
// Timestamp the built container with the current date and time.
// This is currently only supported by the Pack builder.
Timestamp bool

// ManagementDisabled disables automatic Function CR sync after deploy.
ManagementDisabled bool
}

// newDeployConfig creates a buildConfig populated from command flags and
Expand All @@ -576,6 +581,7 @@ func newDeployConfig(cmd *cobra.Command) deployConfig {
ServiceAccountName: viper.GetString("service-account"),
ImagePullSecret: viper.GetString("image-pull-secret"),
Deployer: viper.GetString("deployer"),
ManagementDisabled: viper.GetBool("management-disabled"),
}
// NOTE: .Env should be viper.GetStringSlice, but this returns unparsed
// results and appears to be an open issue since 2017:
Expand Down Expand Up @@ -612,6 +618,7 @@ func (c deployConfig) Configure(f fn.Function) (fn.Function, error) {
f.Deploy.ServiceAccountName = c.ServiceAccountName
f.Deploy.ImagePullSecret = c.ImagePullSecret
f.Deploy.Deployer = c.Deployer
f.Deploy.ManagementDisabled = c.ManagementDisabled
f.Local.Remote = c.Remote

// PVCSize
Expand Down
1 change: 1 addition & 0 deletions docs/reference/func_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func deploy
-h, --help help for deploy
-i, --image string Full image name in the form [registry]/[namespace]/[name]:[tag]@[digest]. This option takes precedence over --registry. Specifying digest is optional, but if it is given, 'build' and 'push' phases are disabled. ($FUNC_IMAGE)
--image-pull-secret string Image pull secret to use when the function's image is in a private registry ($FUNC_IMAGE_PULL_SECRET)
--management-disabled Disable operator management of this function ($FUNC_MANAGEMENT_DISABLED)
-n, --namespace string Deploy into a specific namespace. Will use the function's current namespace by default if already deployed, and the currently active context if it can be determined. ($FUNC_NAMESPACE) (default "default")
--password string Password to use when pushing to the registry. ($FUNC_PASSWORD)
-p, --path string Path to the function. Default is current directory ($FUNC_PATH)
Expand Down
50 changes: 26 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module knative.dev/func

go 1.25.7
go 1.26
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I presume this was necessary due to controller-runtime dependency? Maybe just add to the commit description this PR also bumps to Go 1.26

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, required by controller-runtime. Added a note to the PR description.


// this is required bacause of bad dep in github.com/openshift-pipelines/pipelines-as-code
replace github.com/imdario/mergo => dario.cat/mergo v1.0.1
Expand All @@ -24,6 +24,7 @@ require (
github.com/docker/docker v28.5.2+incompatible
github.com/docker/docker-credential-helpers v0.9.5
github.com/docker/go-connections v0.7.0
github.com/functions-dev/func-operator v0.2.1
github.com/go-git/go-billy/v5 v5.8.0
github.com/go-git/go-git/v5 v5.18.0
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -67,12 +68,13 @@ require (
k8s.io/apimachinery v0.35.4
k8s.io/client-go v0.35.4
k8s.io/klog/v2 v2.140.0
k8s.io/utils v0.0.0-20260108192941-914a6e750570
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
knative.dev/client/pkg v0.0.0-20260508023525-0b520ca5254e
knative.dev/eventing v0.49.1-0.20260506130425-5a46719f32de
knative.dev/hack v0.0.0-20260428014158-b2a37f1b6e7b
knative.dev/pkg v0.0.0-20260507212125-df317a52d112
knative.dev/serving v0.49.1-0.20260508141527-06f2ba70f0cc
sigs.k8s.io/controller-runtime v0.23.3
)

require (
Expand All @@ -92,7 +94,7 @@ require (
github.com/Azure/go-autorest/tracing v0.6.1 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/ProtonMail/go-crypto v1.4.0 // indirect
github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
Expand Down Expand Up @@ -157,20 +159,20 @@ require (
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.22.4 // indirect
github.com/go-openapi/jsonreference v0.21.4 // indirect
github.com/go-openapi/swag v0.25.4 // indirect
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/mangling v0.25.4 // indirect
github.com/go-openapi/swag/netutils v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/jsonreference v0.21.5 // indirect
github.com/go-openapi/swag v0.25.5 // indirect
github.com/go-openapi/swag/cmdutils v0.25.5 // indirect
github.com/go-openapi/swag/conv v0.25.5 // indirect
github.com/go-openapi/swag/fileutils v0.25.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
github.com/go-openapi/swag/loading v0.25.5 // indirect
github.com/go-openapi/swag/mangling v0.25.5 // indirect
github.com/go-openapi/swag/netutils v0.25.5 // indirect
github.com/go-openapi/swag/stringutils v0.25.5 // indirect
github.com/go-openapi/swag/typeutils v0.25.5 // indirect
github.com/go-openapi/swag/yamlutils v0.25.5 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
Expand Down Expand Up @@ -200,8 +202,9 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
Expand Down Expand Up @@ -241,7 +244,7 @@ require (
github.com/opencontainers/selinux v1.13.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
Expand All @@ -260,7 +263,7 @@ require (
github.com/segmentio/encoding v0.5.3 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand Down Expand Up @@ -299,7 +302,7 @@ require (
go.uber.org/zap v1.28.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/time v0.15.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
Expand All @@ -314,14 +317,13 @@ require (
k8s.io/apiextensions-apiserver v0.35.4 // indirect
k8s.io/apiserver v0.35.4 // indirect
k8s.io/cli-runtime v0.34.1 // indirect
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect
knative.dev/networking v0.0.0-20260506015723-9b427f7c8091 // indirect
sigs.k8s.io/controller-runtime v0.22.1 // indirect
sigs.k8s.io/gateway-api v1.4.1 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kustomize/api v0.21.0 // indirect
sigs.k8s.io/kustomize/kyaml v0.21.0 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
Loading
Loading