Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 661025b

Browse files
authored
Merge pull request #781 from JoshVanL/automated-cherry-pick-of-#779-origin-release-0.6
Automated cherry pick of #779
2 parents 5df7219 + 7e5dd24 commit 661025b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/tarmak/ssh/tunnel.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func (s *SSH) Tunnel(dest, destPort, localPort string, daemonize bool) interface
5757
destPort: destPort,
5858
daemonize: daemonize,
5959
localPort: localPort,
60+
doneCh: make(chan struct{}),
6061
}
6162

6263
s.tunnels = append(s.tunnels, tunnel)
@@ -213,7 +214,12 @@ func (t *Tunnel) handleTimeout() {
213214
t.connsLock.Unlock()
214215

215216
t.cleanup()
216-
close(t.doneCh)
217+
218+
select {
219+
case <-t.doneCh:
220+
default:
221+
close(t.doneCh)
222+
}
217223
}
218224

219225
func (t *Tunnel) Done() <-chan struct{} {

0 commit comments

Comments
 (0)