diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-03-08 18:48:26 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-03-08 18:48:26 +0100 |
| commit | 36d1c4540af3ef058d68092e41af05aa4a8c5eca (patch) | |
| tree | 3657a5920e4b100749ccb9d2d555652e7b7e28e9 /vm/gce | |
| parent | 63ef857906766b3cafe4aebc43bc38edf42096c3 (diff) | |
all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
Diffstat (limited to 'vm/gce')
| -rw-r--r-- | vm/gce/gce.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 5be790b76..bdb7911f8 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -55,11 +55,9 @@ type instance struct { debug bool name string ip string - offset int64 gceKey string // per-instance private ssh key associated with the instance sshKey string // ssh key sshUser string - workdir string closed chan bool } @@ -155,8 +153,8 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) { pool.GCE.DeleteInstance(name, true) } }() - sshKey := pool.env.SshKey - sshUser := pool.env.SshUser + sshKey := pool.env.SSHKey + sshUser := pool.env.SSHUser if sshKey == "" { // Assuming image supports GCE ssh fanciness. sshKey = gceKey @@ -261,7 +259,7 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin } if bytes.Contains(output, permissionDeniedMsg) { // This is a GCE bug. - break + break loop } case <-timeout.C: break loop @@ -312,9 +310,9 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin go func() { select { case <-time.After(timeout): - signal(vmimpl.TimeoutErr) + signal(vmimpl.ErrTimeout) case <-stop: - signal(vmimpl.TimeoutErr) + signal(vmimpl.ErrTimeout) case <-inst.closed: signal(fmt.Errorf("instance closed")) case err := <-merger.Err: @@ -330,13 +328,13 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin // Console connection must never fail. If it does, it's either // instance preemption or a GCE bug. In either case, not a kernel bug. Logf(1, "%v: gce console connection failed with %v", inst.name, merr.Err) - err = vmimpl.TimeoutErr + err = vmimpl.ErrTimeout } else { // Check if the instance was terminated due to preemption or host maintenance. time.Sleep(5 * time.Second) // just to avoid any GCE races if !inst.GCE.IsInstanceRunning(inst.name) { Logf(1, "%v: ssh exited but instance is not running", inst.name) - err = vmimpl.TimeoutErr + err = vmimpl.ErrTimeout } } signal(err) |
