aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-12-26 11:43:44 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-12-27 09:18:26 +0100
commit376f424e08d4b45fe7d27dd02de231899342c012 (patch)
treec61d2dfc1430faba072c4e01c28d2a9e74f51424 /vm/gce
parentb7b7ac19fd9e2afbf5aea4db5e3f318576e6809f (diff)
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
Diffstat (limited to 'vm/gce')
-rw-r--r--vm/gce/gce.go4
1 files changed, 2 insertions, 2 deletions
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