[REV] git clone ssh Insecure Ignore HostKey for 3.5

This commit is contained in:
barnett 2018-04-08 15:20:04 +08:00
parent a45c6d0c81
commit 1c091f38cb

View File

@ -36,6 +36,7 @@ import (
"github.com/goodrain/rainbond/pkg/event" "github.com/goodrain/rainbond/pkg/event"
"github.com/goodrain/rainbond/pkg/util" "github.com/goodrain/rainbond/pkg/util"
netssh "golang.org/x/crypto/ssh"
git "gopkg.in/src-d/go-git.v4" git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/sideband" "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/sideband"
@ -144,6 +145,7 @@ func GitClone(csi CodeSourceInfo, sourceDir string, logger event.Logger, timeout
} }
return nil, auerr return nil, auerr
} }
sshAuth.HostKeyCallbackHelper.HostKeyCallback = netssh.InsecureIgnoreHostKey()
opts.Auth = sshAuth opts.Auth = sshAuth
rs, err = git.PlainCloneContext(ctx, sourceDir, false, opts) rs, err = git.PlainCloneContext(ctx, sourceDir, false, opts)
} else { } else {