summaryrefslogtreecommitdiff
path: root/internal/sshd/session.go
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2022-04-14 05:47:34 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2022-04-14 05:47:34 +0000
commit5fe0d17f11eb122d45bad9126c7c0646e196b1c5 (patch)
treebc89cbdc9ec3ca400305975e83363669fe639e69 /internal/sshd/session.go
parent9abd6d79043f90057ff9a7bf9deecb868e83c46d (diff)
parentcc353a57f3aa8f3f751c175ea596d2baca0b1f19 (diff)
downloadgitlab-shell-5fe0d17f11eb122d45bad9126c7c0646e196b1c5.tar.gz
Merge branch 'id-metrics-for-results' into 'main'
Add additional metrics to gitlab-sshd See merge request gitlab-org/gitlab-shell!593
Diffstat (limited to 'internal/sshd/session.go')
-rw-r--r--internal/sshd/session.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/sshd/session.go b/internal/sshd/session.go
index ff8540b..beb529e 100644
--- a/internal/sshd/session.go
+++ b/internal/sshd/session.go
@@ -22,6 +22,7 @@ type session struct {
channel ssh.Channel
gitlabKeyId string
remoteAddr string
+ success bool
// State managed by the session
execCmd string
@@ -182,6 +183,8 @@ func (s *session) exit(ctx context.Context, status uint32) {
log.WithContextFields(ctx, log.Fields{"exit_status": status}).Info("session: exit: exiting")
req := exitStatusReq{ExitStatus: status}
+ s.success = status == 0
+
s.channel.CloseWrite()
s.channel.SendRequest("exit-status", false, ssh.Marshal(req))
}