in operatortrace-go/pkg/handlers/owns.go [257:285]
func requestWithTraceIDToRequest(requests map[requestWithTraceID]empty) map[reconcile.Request]empty {
result := map[reconcile.Request]empty{}
// todo
// dedupe based on name, if the name is the same, choose the one that is "new" eventKind
// todo
for req := range requests {
key := reconcile.Request{}
var name string
if req.TraceID != "" && req.SpanID != "" {
name = fmt.Sprintf("%s;%s;%s;%s;%s", req.TraceID, req.SpanID, req.SenderKind, req.SenderName, req.NamespacedName.Name)
} else {
name = req.NamespacedName.Name
}
// Embed the trace ID in the NamespacedName
namespace := req.NamespacedName.Namespace
key.NamespacedName = types.NamespacedName{
Name: name,
Namespace: namespace,
}
result[key] = empty{}
}
return result
}