Skip to content

EventType Automatic Registration support for PingSource #7165

@Leo6Leo

Description

@Leo6Leo

Describe the bug
In the rekt test below, SendsEventsWithEventTypes tests pingsource to a ready broker.

func SendsEventsWithEventTypes() *feature.Feature {

As we can see from the log of the sink, the event has been well received.

2023-08-10T15:22:00.138Z	info	eventshub.event logger	logger_vent/logger.go:26	Event: 
-- EventInfo --
--- Kind: Received ---
--- Event ---
Context Attributes,
  specversion: 1.0
  type: dev.knative.sources.ping
  source: /apis/v1/namespaces/test-gkecyytx/pingsources/source-ipmucxfj
  id: 14aa96a4-89c5-4d93-8945-e7750f51cff7
  time: 2023-08-10T15:22:00.018773285Z
  datacontenttype: text/plain
Extensions,
  knativearrivaltime: 2023-08-10T15:22:00.023940759Z
Data,
  hello, world!

--- HTTP headers ---
  Kn-Namespace: test-gkecyytx
  Content-Type: text/plain
  Traceparent: 00-ae4e4509ba3602d5680b79d8d4ed4feb-c193cd3c7d75d240-01
  Accept-Encoding: gzip
  Prefer: reply
  Content-Length: 13
  Host: sink-pgiemmct.test-gkecyytx.svc.cluster.local
  User-Agent: Go-http-client/1.1

--- Origin: '10.244.0.110:42094' ---
--- Observer: 'sink-pgiemmct' ---
--- Time: 2023-08-10 15:22:00.132399467 +0000 UTC m=+35.796616450 ---
--- Sequence: 1 ---
--- Sent Id:  ' ---
--------------------

2023-08-10T15:23:00.462Z	info	eventshub	recorder_vent/recorder.go:106	Event 'sink-pgiemmct.Received.2' sent correctly, uuid: 74d3162c-7473-4205-a274-6f5f7d88c010
2023-08-10T15:23:00.462Z	info	eventshub.event logger	logger_vent/logger.go:26	Event: 
-- EventInfo --
--- Kind: Received ---
--- Event ---
Context Attributes,
  specversion: 1.0
  type: dev.knative.sources.ping
  source: /apis/v1/namespaces/test-gkecyytx/pingsources/source-ipmucxfj
  id: 080a0b91-5385-4d0a-b9de-cb75d4ea1c8a
  time: 2023-08-10T15:23:00.443903747Z
  datacontenttype: text/plain
Extensions,
  knativearrivaltime: 2023-08-10T15:23:00.447977714Z
Data,
  hello, world!

--- HTTP headers ---
  User-Agent: Go-http-client/1.1
  Content-Type: text/plain
  Accept-Encoding: gzip
  Content-Length: 13
  Kn-Namespace: test-gkecyytx
  Traceparent: 00-6d38eb75d78d1409ac7a1b76dd121828-1dd14edee38bea4f-01
  Host: sink-pgiemmct.test-gkecyytx.svc.cluster.local
  Prefer: reply

--- Origin: '10.244.0.110:42094' ---
--- Observer: 'sink-pgiemmct' ---
--- Time: 2023-08-10 15:23:00.456934302 +0000 UTC m=+96.121151275 ---
--- Sequence: 2 ---
--- Sent Id:  ' ---
--------------------

But there is no eventType object is created.

Expected behavior
An eventType object should be created, and when we do kubectl get eventtypes.eventing.knative.dev -A, we should get a record show up for the corresponding eventType.

To Reproduce

  1. Run the rekt test with the command SYSTEM_NAMESPACE=knative-eventing go test -v -tags=e2e -count=1 -run TestPingSourceWithEventTypes -parallel=12 -timeout=30m ./test/rekt
  2. While the test is running, check the sink log, and the kubectl get eventtypes.eventing.knative.dev -A

Knative release version

Additional context
The broker in the rekt test is default to MTChannelBasedBroker

BrokerClass string `envconfig:"BROKER_CLASS" default:"MTChannelBasedBroker" required:"true"`

Related to this issue: The reason why the tests are passing before is because the logical error in the rekt test as stated in this issue #7158

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/feature-requestlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    Status

    ✅ Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions