Empty CloudEvents ID with "func invoke"
See here, using func invoke..., we do see an empty ID, when sending:
func invoke -f=cloudevent --data='{"reviewText":"I love Knative so much"}' -v
Invoking '' function at http://sentiment-analysis-app.default.10.99.189.63.sslip.io
Invoking '' function using 'cloudevent' format
Sending event
Context Attributes,
specversion: 1.0
type: boson.fn
source: /boson/fn
id:
datacontenttype: application/json
Data,
{
"reviewText": "I love Knative so much"
}
Function invoked. Response:
Context Attributes,
specversion: 1.0
type: moderated-comment
source: sentiment-analysis
id: 10a746c8-dd35-433c-9497-e6efcb5f946b
time: 2024-06-25T12:07:12.923682Z
datacontenttype: application/json
Extensions,
badwordfilter:
sentimentresult: positive
Data,
{
"reviewText": "I love Knative so much",
"badWordResult": "",
"sentimentResult": "positive"
}
reference: https://github.com/knative/docs/pull/6007#discussion_r1652685240
@matzew I am interested to work on this, but need help, can you explain more? How can it be reproduce? I have my running k8s cluster and in there serving and eventing both running. For functions what I need to do.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
Hi @ayushrakesh,
You can create a CloudEvent Function using func init --language go --template cloudevent.
deploy the function using func deploy. Once running and available, run func invoke and a test CloudEvent will be sent to the Function.
It would be ideal if this test CloudEvent populated the ID field, even if just with a random UUID.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.