don't use socat for port forwarding

use goroutines to copy the data from the stream to the TCP
connection, and viceversa, removing the socat dependency.

Quoting Lantao Liu, the logic is as follow:

When one side (either pod side or user side) of portforward
is closed, we should stop port forwarding.

When one side is closed, the io.Copy use that side as source will close,
but the io.Copy use that side as dest won't.

Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
This commit is contained in:
Antonio Ojea
2020-05-05 18:18:38 +02:00
parent 65830369b6
commit 11a78d9d0f
5 changed files with 62 additions and 51 deletions

View File

@@ -107,8 +107,7 @@ jobs:
sudo apt-get install -y \
btrfs-tools \
libseccomp2 \
libseccomp-dev \
socat
libseccomp-dev
make install.deps
working-directory: ${{github.workspace}}/src/github.com/containerd/cri