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

CloudEvents content doesn't reflect correct emitter namespace and subject type #5278

Closed
JorTurFer opened this issue Dec 11, 2023 · 2 comments · Fixed by #5279
Closed

CloudEvents content doesn't reflect correct emitter namespace and subject type #5278

JorTurFer opened this issue Dec 11, 2023 · 2 comments · Fixed by #5279
Labels
bug Something isn't working

Comments

@JorTurFer
Copy link
Member

JorTurFer commented Dec 11, 2023

Report

we emit an event like this:

{
    "specversion" : "1.0",
    "type" : "com.cloudeventsource.keda",
    "source" : "/{cluster-name}/{namespace}/keda",
    "subject" : "/{cluster-name}/{namespace}/workload/{scaledobject-name}",
    "id" : "<guid>",
    "time" : "2018-04-05T17:31:00Z",
    "datacontenttype" : "application/json",
    "data" : {
      "reason":"<event-reason>",
      "message":"<event-message>"
   }
}

The source is /{cluster-name}/{namespace}/keda but the emitter is /{cluster-name}/{keda-namespace}/keda because it's KEDA who emits the event and not the resource itself, who is the subject indeed.

In the same way, the subject should be /{cluster-name}/{namespace}/{object-type}/{object-name} instead of /{cluster-name}/{namespace}/workload/{scaledobject-name} because now we are emitting events only for ScaledObjects, but we plan to extend to other resources, and workload doesn't make sense at that point.

{
    "specversion" : "1.0",
    "type" : "com.cloudeventsource.keda",
    "source" : "/{cluster-name}/{keda-namespace}/keda",
    "subject" : "/{cluster-name}/{namespace}/{object-type}/{object-name}",
    "id" : "<guid>",
    "time" : "2018-04-05T17:31:00Z",
    "datacontenttype" : "application/json",
    "data" : {
      "reason":"<event-reason>",
      "message":"<event-message>"
   }
}
@JorTurFer JorTurFer added the bug Something isn't working label Dec 11, 2023
@JorTurFer JorTurFer changed the title Update CloudEvents content CloudEvents content doesn't reflect correct emitter namespace and subject type Dec 11, 2023
@JorTurFer
Copy link
Member Author

@SpiritZhou WDYT?

@SpiritZhou
Copy link
Contributor

I agree. I think it's clearer.

@github-project-automation github-project-automation bot moved this from To Triage to Ready To Ship in Roadmap - KEDA Core Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants