Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Wilken Rivera <[email protected]>
  • Loading branch information
lbajolet-hashicorp and Wilken Rivera authored Jul 27, 2022
1 parent 423d7d0 commit 78d4c93
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions communicator/step_connect_ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ func (s *StepConnectSSH) Run(ctx context.Context, state multistep.StateBag) mult
}()

log.Printf("[INFO] Waiting for SSH, up to timeout: %s", s.Config.SSHTimeout)
var timeout <-chan time.Time
// Only setup a timeout when it is specified in the configs
if s.Config.SSHTimeout != 0 {
timeout := make(<-chan time.Time)
if s.Config.SSHTimeout > 0 {
timeout = time.After(s.Config.SSHTimeout)
} else {
timeout = make(<-chan time.Time)
}

}
for {
// Wait for either SSH to become available, a timeout to occur,
// or an interrupt to come through.
Expand Down

0 comments on commit 78d4c93

Please sign in to comment.