EventType Automatic Registration support for PingSource
Describe the bug In the rekt test below, SendsEventsWithEventTypes tests pingsource to a ready broker. https://github.com/knative/eventing/blob/86e9804285dedd8819ee437058661dd2af18ef4a/test/rekt/features/pingsource/features.go#L134
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
- 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 - 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
https://github.com/knative/eventing/blob/86e9804285dedd8819ee437058661dd2af18ef4a/test/rekt/resources/broker/broker.go#L49
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
/assign
@Leo6Leo did you enable autocreate of eventtypes? Try enabling with:
apiVersion: v1
kind: ConfigMap
metadata:
name: config-features
namespace: knative-eventing
labels:
knative.dev/config-propagation: original
knative.dev/config-category: eventing
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-eventing
data:
# ALPHA feature: The kreference-group allows you to use the Group field in KReferences.
# For more details: https://github.com/knative/eventing/issues/5086
kreference-group: "disabled"
# ALPHA feature: The delivery-retryafter allows you to use the RetryAfter field in DeliverySpec.
# For more details: https://github.com/knative/eventing/issues/5811
delivery-retryafter: "disabled"
# BETA feature: The delivery-timeout allows you to use the Timeout field in DeliverySpec.
# For more details: https://github.com/knative/eventing/issues/5148
delivery-timeout: "enabled"
# ALPHA feature: The kreference-mapping allows you to map kreference onto templated URI
# For more details: https://github.com/knative/eventing/issues/5593
kreference-mapping: "disabled"
# ALPHA feature: The new-trigger-filters flag allows you to use the new `filters` field
# in Trigger objects with its rich filtering capabilities.
# For more details: https://github.com/knative/eventing/issues/5204
new-trigger-filters: "disabled"
# ALPHA feature: The transport-encryption flag allows you to encrypt events in transit using the transport layer security (TLS) protocol.
# For more details: https://github.com/knative/eventing/issues/5957
transport-encryption: "disabled"
# ALPHA feature: The eventtype-auto-create flag allows automatic creation of Even Type instances based on Event's type being processed.
# For more details: https://github.com/knative/eventing/issues/6909
eventtype-auto-create: "enabled"
Per conversation with @Leo6Leo this doesn't seem to be a bug with the new auto-create logic so I am going to unassign myself.
I enabled it and it works expected. Thanks @Cali0707
As Knative documentation said, Support for automatic registration is not supported for PingSource.
Should we add the support for PingSource to have auto eventType creation? Or we will enable the broker-side eventType auto creation for PingSource's rekt test? @creydr @matzew @dsimansk
/unassign
/remove-kind bug /kind feature-request
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.
Reopen this issue as we will reconsider this in tandem with https://github.com/knative/eventing/issues/7258, as they are related
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.