Skip to content

[supervisor] log ssh tunnel read error #18286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2023
Merged
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
7 changes: 6 additions & 1 deletion components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1295,14 +1295,19 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv
return
}

log.Infof("tunnel ssh: Connected from %s", conn.RemoteAddr())

conn2, err := net.Dial("tcp", net.JoinHostPort("localhost", strconv.FormatInt(int64(cfg.SSHPort), 10)))
if err != nil {
log.WithError(err).Error("tunnel ssh: dial to ssh server failed")
return
}

go io.Copy(conn, conn2)
_, _ = io.Copy(conn2, conn)
_, err = io.Copy(conn2, conn)
if err != nil {
log.WithError(err).Error("tunnel ssh: error returned from io.copy")
}

conn.Close()
conn2.Close()
Expand Down