CloudEvents content doesn't reflect correct emitter namespace and subject type #5278
Closed
Description
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>"
}
}
Metadata
Assignees
Labels
Type
Projects
Status
Ready To Ship