sessionrecording: add destination to struct for tsrecorder (#17520)

when tsrecorder receives events, it populates this field with
information about the node the request was sent to.

Updates #17141

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
This commit is contained in:
Tom Meadows 2025-10-10 11:27:55 +01:00 committed by GitHub
parent 072e6a39f4
commit 08eae9affd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,6 +37,9 @@ type Event struct {
// Source provides details about the client that initiated the request.
Source Source `json:"source"`
// Destination provides details about the node receiving the request.
Destination Destination `json:"destination"`
}
// copied from https://github.com/kubernetes/kubernetes/blob/11ade2f7dd264c2f52a4a1342458abbbaa3cb2b1/staging/src/k8s.io/apiserver/pkg/endpoints/request/requestinfo.go#L44
@ -95,6 +98,17 @@ type Source struct {
NodeUser string `json:"nodeUser,omitempty"`
}
type Destination struct {
// Node is the FQDN of the node receiving the connection.
// It is also the MagicDNS name for the node.
// It does not have a trailing dot.
// e.g. "host.tail-scale.ts.net"
Node string `json:"node"`
// NodeID is the node ID of the node receiving the connection.
NodeID tailcfg.StableNodeID `json:"nodeID"`
}
// Request holds information about a request.
type Request struct {
Method string `json:"method"`