func icon indicating copy to clipboard operation
func copied to clipboard

Empty CloudEvents ID with "func invoke"

Open matzew opened this issue 1 year ago • 3 comments

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 avatar Jun 26 '24 06:06 matzew

@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.

ayushrakesh avatar Jun 27 '24 05:06 ayushrakesh

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.

github-actions[bot] avatar Sep 26 '24 01:09 github-actions[bot]

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.

lkingland avatar Feb 28 '25 02:02 lkingland

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.

github-actions[bot] avatar May 31 '25 01:05 github-actions[bot]