Merge pull request #586 from sjones303/FixPortCheck

Use address:port tuple when checking port forwarding
mine
Fernand Galiana 2020-02-28 22:30:40 -07:00 committed by GitHub
commit 2fa4d5f784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -72,8 +72,8 @@ func (p *PortForwardExtender) fetchPodName(path string) (string, error) {
// ----------------------------------------------------------------------------
// Helpers...
func tryListenPort(port string) error {
server, err := net.Listen("tcp", fmt.Sprintf(":%s", port))
func tryListenPort(address, port string) error {
server, err := net.Listen("tcp", fmt.Sprintf("%s:%s", address, port))
if err != nil {
return err
}
@ -101,7 +101,7 @@ func runForward(v ResourceViewer, pf watch.Forwarder, f *portforward.PortForward
}
func startFwdCB(v ResourceViewer, path, co string, t client.PortTunnel) {
err := tryListenPort(t.LocalPort)
err := tryListenPort(t.Address, t.LocalPort)
if err != nil {
v.App().Flash().Err(err)
return