Skip to content

Commit 5b0541a

Browse files
authored
Add more tunnel ssh loggging (#18286)
1 parent c747c1e commit 5b0541a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,14 +1294,19 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv
12941294
return
12951295
}
12961296

1297+
log.Infof("tunnel ssh: Connected from %s", conn.RemoteAddr())
1298+
12971299
conn2, err := net.Dial("tcp", net.JoinHostPort("localhost", strconv.FormatInt(int64(cfg.SSHPort), 10)))
12981300
if err != nil {
12991301
log.WithError(err).Error("tunnel ssh: dial to ssh server failed")
13001302
return
13011303
}
13021304

13031305
go io.Copy(conn, conn2)
1304-
_, _ = io.Copy(conn2, conn)
1306+
_, err = io.Copy(conn2, conn)
1307+
if err != nil {
1308+
log.WithError(err).Error("tunnel ssh: error returned from io.copy")
1309+
}
13051310

13061311
conn.Close()
13071312
conn2.Close()

0 commit comments

Comments
 (0)