Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function makeDesktopRecording({

function makeSshOrKubeRecording({
participants,
user,
time,
session_start,
session_stop,
Expand All @@ -80,9 +81,13 @@ function makeSshOrKubeRecording({
);

let hostname = server_hostname || 'N/A';
// SSH interactive/non-interactive and k8s interactive sessions user participants are in the participants field.
let userParticipants = participants;
// For Kubernetes sessions, put the full pod name as 'hostname'.
if (proto === 'kube') {
hostname = `${kubernetes_cluster}/${kubernetes_pod_namespace}/${kubernetes_pod_name}`;
// For non-interactive k8s sessions the participant is the Teleport user running the command
if (!interactive) userParticipants = [user];
}

// Description set to play for interactive so users can search by "play".
Expand All @@ -97,7 +102,7 @@ function makeSshOrKubeRecording({
durationText,
sid,
createdDate: time,
users: participants ? participants.join(', ') : [],
users: userParticipants ? userParticipants.join(', ') : [],
hostname,
description,
recordingType: kubernetes_cluster ? 'k8s' : 'ssh',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('fetch session recordings, response formatting', async () => {
playable: false,
recordingType: 'k8s',
sid: '456b933c-4ec4-59f1-862c-90ca9f7648b1',
users: [],
users: 'onuweeme@wiuke.mh',
},
],
startKey: '',
Expand Down