From 376f424e08d4b45fe7d27dd02de231899342c012 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Dec 2017 11:43:44 +0100 Subject: vm/gce: connect to instances by ip Don't connect by hostname, this seems to be broken on GCE. Episodically connecting by hostname gives: Could not resolve hostname: Name or service not known --- vm/gce/gce.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm/gce') diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 1ea5a2db4..01cbc7bd4 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -193,7 +193,7 @@ func (inst *instance) Forward(port int) (string, error) { func (inst *instance) Copy(hostSrc string) (string, error) { vmDst := "./" + filepath.Base(hostSrc) - args := append(sshArgs(inst.debug, inst.sshKey, "-P", 22), hostSrc, inst.sshUser+"@"+inst.name+":"+vmDst) + args := append(sshArgs(inst.debug, inst.sshKey, "-P", 22), hostSrc, inst.sshUser+"@"+inst.ip+":"+vmDst) if _, err := runCmd(inst.debug, "scp", args...); err != nil { return "", err } @@ -287,7 +287,7 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin command = fmt.Sprintf("sudo bash -c '%v'", command) } } - args := append(sshArgs(inst.debug, inst.sshKey, "-p", 22), inst.sshUser+"@"+inst.name, command) + args := append(sshArgs(inst.debug, inst.sshKey, "-p", 22), inst.sshUser+"@"+inst.ip, command) ssh := osutil.Command("ssh", args...) ssh.Stdout = sshWpipe ssh.Stderr = sshWpipe -- cgit mrf-deployment