Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not pass CloudEvent type attribute via ceOverrides #70

Closed
antoineco opened this issue Aug 31, 2021 · 1 comment
Closed

Do not pass CloudEvent type attribute via ceOverrides #70

antoineco opened this issue Aug 31, 2021 · 1 comment

Comments

@antoineco
Copy link
Contributor

The two sources labeled on this issue hack the ceOverrides spec in order to override the type attribute of CloudEvents sent by their receive adapter:

https://github.com/triggermesh/event-sources/blob/7dfd216b238e65228c081729fe858c36065ce6a6/pkg/reconciler/azureactivitylogssource/adapter.go#L129-L132

This practice is strongly discouraged, and the only reason why it currently works is due to a bug in the client library:

When spec.ceOverrides.extensions is specified and non-empty, the event sent to the sink is augmented or modified with the specified extension attributes. The source controller MUST reject extensions overriding the required Cloud Events attributes.

-- https://github.com/knative/eventing/blob/5c08bd3d/docs/spec/sources.md#duckspec

We should fix this ASAP by using either

  • message processors (e.g. setting it to "activity-logs" enables knowledge about Activity Logs payloads)
  • a plain env var such as CE_TYPE, which may work when only 1 type is expected
  • other suggestions
@antoineco antoineco transferred this issue from another repository Oct 1, 2021
@antoineco
Copy link
Contributor Author

Done in #423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant