From 08ff5521a43ed1adaa5e2db0f82729760bc3d24d Mon Sep 17 00:00:00 2001 From: Anurag Ojha Date: Thu, 30 Oct 2025 18:01:34 +0000 Subject: [PATCH 1/4] added changes --- cmd/invoke.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/invoke.go b/cmd/invoke.go index 775ad10e68..6b258aeb9d 100644 --- a/cmd/invoke.go +++ b/cmd/invoke.go @@ -259,6 +259,11 @@ func newInvokeConfig() (cfg invokeConfig, err error) { cfg.Data = b } + switch strings.ToLower(cfg.Format) { + case "cloudevent", "cloudevents": + cfg.Format = "cloudevents" + } + // if not in confirm/prompting mode, the cfg structure is complete. if !cfg.Confirm { return From ff154399bd836a7c64ca45301a220bf1a67e5318 Mon Sep 17 00:00:00 2001 From: Anurag Ojha Date: Sat, 1 Nov 2025 09:28:30 +0000 Subject: [PATCH 2/4] help section --- cmd/invoke.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/invoke.go b/cmd/invoke.go index 6b258aeb9d..ef57f1444b 100644 --- a/cmd/invoke.go +++ b/cmd/invoke.go @@ -119,7 +119,7 @@ EXAMPLES } // Flags - cmd.Flags().StringP("format", "f", "", "Format of message to send, 'http' or 'cloudevent'. Default is to choose automatically. ($FUNC_FORMAT)") + cmd.Flags().StringP("format", "f", "", "Format of message to send, 'http' or 'cloudevent(s)'. Default is to choose automatically. ($FUNC_FORMAT)") cmd.Flags().StringP("target", "t", "", "Function instance to invoke. Can be 'local', 'remote' or a URL. Defaults to auto-discovery if not provided. ($FUNC_TARGET)") cmd.Flags().StringP("id", "", "", "ID for the request data. ($FUNC_ID)") cmd.Flags().StringP("source", "", fn.DefaultInvokeSource, "Source value for the request data. ($FUNC_SOURCE)") From ed87a1f1e2f2eadc20a2fd921d37b6e60ddb7d98 Mon Sep 17 00:00:00 2001 From: Anurag Ojha Date: Sat, 1 Nov 2025 09:36:30 +0000 Subject: [PATCH 3/4] docs/reference/func_invoke.md --- docs/reference/func_invoke.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/func_invoke.md b/docs/reference/func_invoke.md index a904be2cbf..0ecaeb3529 100644 --- a/docs/reference/func_invoke.md +++ b/docs/reference/func_invoke.md @@ -100,7 +100,7 @@ func invoke --content-type string Content Type of the data. ($FUNC_CONTENT_TYPE) (default "application/json") --data string Data to send in the request. ($FUNC_DATA) (default "{\"message\":\"Hello World\"}") --file string Path to a file to use as data. Overrides --data flag and should be sent with a correct --content-type. ($FUNC_FILE) - -f, --format string Format of message to send, 'http' or 'cloudevent'. Default is to choose automatically. ($FUNC_FORMAT) + -f, --format string Format of message to send, 'http' or 'cloudevent(s)'. Default is to choose automatically. ($FUNC_FORMAT) -h, --help help for invoke --id string ID for the request data. ($FUNC_ID) -i, --insecure Allow insecure server connections when using SSL. ($FUNC_INSECURE) From 98196102aa1b373415c9a40e1babd462348bcce2 Mon Sep 17 00:00:00 2001 From: Anurag Ojha Date: Wed, 5 Nov 2025 10:14:29 +0000 Subject: [PATCH 4/4] reverse the logic --- cmd/invoke.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/invoke.go b/cmd/invoke.go index ef57f1444b..d2a05fb0ff 100644 --- a/cmd/invoke.go +++ b/cmd/invoke.go @@ -261,7 +261,7 @@ func newInvokeConfig() (cfg invokeConfig, err error) { switch strings.ToLower(cfg.Format) { case "cloudevent", "cloudevents": - cfg.Format = "cloudevents" + cfg.Format = "cloudevent" } // if not in confirm/prompting mode, the cfg structure is complete.