summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-10-06 13:03:27 +0100
committerNick Thomas <nick@gitlab.com>2021-10-06 13:03:27 +0100
commitb33de0edb56f99f0fdcb7e10ab2a1fa0ef1e4d69 (patch)
tree03d3a04404189b41dc959480ccd6fc0d9d1cec30
parent2dafe37c77233152b55e1c5d893a81a9cffd2618 (diff)
downloadgitlab-shell-fix-logging-channel-type.tar.gz
Fix logging channel typefix-logging-channel-type
Currently we get this in some log messages: logrus_error="can not add field \"channel_type\"" This is because we're trying to add a function, rather than the result of the function call (a string) to the `log.Fields`. Whoops! Changelog: fixed
-rw-r--r--internal/sshd/connection.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/sshd/connection.go b/internal/sshd/connection.go
index c8f5c00..f6d8fb5 100644
--- a/internal/sshd/connection.go
+++ b/internal/sshd/connection.go
@@ -34,7 +34,7 @@ func (c *connection) handle(ctx context.Context, chans <-chan ssh.NewChannel, ha
defer metrics.SshdConnectionDuration.Observe(time.Since(c.begin).Seconds())
for newChannel := range chans {
- ctxlog.WithField("channel_type", newChannel.ChannelType).Info("connection: handle: new channel requested")
+ ctxlog.WithField("channel_type", newChannel.ChannelType()).Info("connection: handle: new channel requested")
if newChannel.ChannelType() != "session" {
ctxlog.Info("connection: handle: unknown channel type")
newChannel.Reject(ssh.UnknownChannelType, "unknown channel type")