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
2 changes: 2 additions & 0 deletions lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@ func (tc *TeleportClient) Join(ctx context.Context, mode types.SessionParticipan
}
}

fmt.Printf("Joining session with participant mode: %v. \n\n", mode)

// running shell with a given session means "join" it:
err = tc.runShell(ctx, nc, mode, session, beforeStart)
return trace.Wrap(err)
Expand Down
2 changes: 2 additions & 0 deletions lib/client/kubesession.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func NewKubeSession(ctx context.Context, tc *TeleportClient, meta types.SessionT
TLSClientConfig: tlsConfig,
}

fmt.Printf("Joining session with participant mode: %v. \n\n", mode)

ws, resp, err := dialer.Dial(joinEndpoint, nil)
if resp != nil && resp.Body != nil {
defer resp.Body.Close()
Expand Down
4 changes: 2 additions & 2 deletions lib/kube/proxy/moderated_sessions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ func TestModeratedSessions(t *testing.T) {

// checks if moderator has joined the session.
// Each time a user joins a session the following message is broadcasted
// User <user> joined the session.
if strings.Contains(stringData, fmt.Sprintf("User %s joined the session.", moderatorUsername)) {
// User <user> joined the session with participant mode: <mode>.
if strings.Contains(stringData, fmt.Sprintf("User %s joined the session with participant mode: moderator.", moderatorUsername)) {
t.Logf("identified that moderator joined the session")
// inform moderator goroutine that the user detected that he joined the
// session.
Expand Down
2 changes: 1 addition & 1 deletion lib/kube/proxy/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ func (s *session) join(p *party) error {
}

s.io.AddWriter(stringID, p.Client.stdoutStream())
s.BroadcastMessage("User %v joined the session.", p.Ctx.User.GetName())
s.BroadcastMessage("User %v joined the session with participant mode: %v.", p.Ctx.User.GetName(), p.Mode)

if p.Mode == types.SessionModeratorMode {
s.eventsWaiter.Add(1)
Expand Down
4 changes: 2 additions & 2 deletions lib/srv/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,8 @@ func (s *session) addParty(p *party, mode types.SessionParticipantMode) error {
// Register this party as one of the session writers (output will go to it).
s.io.AddWriter(string(p.id), p)

s.BroadcastMessage("User %v joined the session.", p.user)
s.log.Infof("New party %v joined session", p.String())
s.BroadcastMessage("User %v joined the session with participant mode: %v.", p.user, p.mode)
s.log.Infof("New party %v joined the session with participant mode: %v.", p.String(), p.mode)

if mode == types.SessionPeerMode {
s.term.AddParty(1)
Expand Down
2 changes: 1 addition & 1 deletion tool/tsh/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func newKubeJoinCommand(parent *kingpin.CmdClause) *kubeJoinCommand {
CmdClause: parent.Command("join", "Join an active Kubernetes session."),
}

c.Flag("mode", "Mode of joining the session, valid modes are observer and moderator").Short('m').Default("moderator").StringVar(&c.mode)
c.Flag("mode", "Mode of joining the session, valid modes are observer, moderator and peer.").Short('m').Default("observer").EnumVar(&c.mode, "observer", "moderator", "peer")
c.Flag("cluster", clusterHelp).Short('c').StringVar(&c.siteName)
c.Arg("session", "The ID of the target session.").Required().StringVar(&c.session)
return c
Expand Down
2 changes: 1 addition & 1 deletion tool/tsh/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ func Run(ctx context.Context, args []string, opts ...cliOption) error {
// join
join := app.Command("join", "Join the active SSH or Kubernetes session")
join.Flag("cluster", clusterHelp).Short('c').StringVar(&cf.SiteName)
join.Flag("mode", "Mode of joining the session, valid modes are observer and moderator").Short('m').Default("peer").StringVar(&cf.JoinMode)
join.Flag("mode", "Mode of joining the session, valid modes are observer, moderator and peer.").Short('m').Default("observer").EnumVar(&cf.JoinMode, "observer", "moderator", "peer")
join.Flag("reason", "The purpose of the session.").StringVar(&cf.Reason)
join.Flag("invite", "A comma separated list of people to mark as invited for the session.").StringsVar(&cf.Invited)
join.Arg("session-id", "ID of the session to join").Required().StringVar(&cf.SessionID)
Expand Down