diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2022-04-14 05:47:34 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2022-04-14 05:47:34 +0000 |
commit | 5fe0d17f11eb122d45bad9126c7c0646e196b1c5 (patch) | |
tree | bc89cbdc9ec3ca400305975e83363669fe639e69 /internal/sshd/session.go | |
parent | 9abd6d79043f90057ff9a7bf9deecb868e83c46d (diff) | |
parent | cc353a57f3aa8f3f751c175ea596d2baca0b1f19 (diff) | |
download | gitlab-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.go | 3 |
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)) } |