Skip to content

Commit

Permalink
Merge pull request #916 from subutai-io/dev
Browse files Browse the repository at this point in the history
#914 Dev -> Master
  • Loading branch information
Dilshat authored Dec 14, 2018
2 parents 537a169 + 20854b6 commit 3c3a9f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/subutai-io/agent/log"
"os"
"path"
"regexp"
)

// The tunnel feature is based on SSH tunnels and works in combination with Subutai Helpers and serves as an easy solution for bypassing NATs.
Expand All @@ -24,6 +25,9 @@ import (
// Tunnels may also be set to be permanent (default) or temporary (ttl in seconds). The default destination port is 22.
// Subutai tunnels have a continuous state checking mechanism which keeps opened tunnels alive and closes outdated tunnels to keep the system network connections clean.
// This mechanism may re-create a tunnel if it was dropped unintentionally (system reboot, network interruption, etc.), but newly created tunnels will have different "entrance" address.
var (
socketRx = regexp.MustCompile(`^\S+:\S+$`)
)

func MigrateTunnels() {

Expand Down Expand Up @@ -135,6 +139,8 @@ func GetSshTunnels() (list []db.SshTunnel) {

// TunDel removes tunnel entry from list and kills running tunnel process
func DelSshTunnel(socket string, pid ...int) {
checkArgument(socketRx.MatchString(socket), "Socket must be in form ip:port")

list, err := db.GetAllTunnels()
if !log.Check(log.WarnLevel, "Reading tunnel list from db", err) {
for _, item := range list {
Expand Down

0 comments on commit 3c3a9f4

Please sign in to comment.