File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -440,7 +440,24 @@ func (l *LimaVzDriver) ForwardGuestAgent() bool {
440440 return l .vSockPort == 0 && l .virtioPort == ""
441441}
442442
443- func (l * LimaVzDriver ) AdditionalSetupForSSH (_ context.Context ) error {
444- <- l .waitSSHLocalPortAccessible
445- return nil
443+ func (l * LimaVzDriver ) AdditionalSetupForSSH (ctx context.Context ) error {
444+ ticker := time .NewTicker (100 * time .Millisecond )
445+ defer ticker .Stop ()
446+
447+ timeout := time .After (60 * time .Second )
448+
449+ for {
450+ if l .waitSSHLocalPortAccessible != nil {
451+ <- l .waitSSHLocalPortAccessible
452+ return nil
453+ }
454+
455+ select {
456+ case <- ctx .Done ():
457+ return ctx .Err ()
458+ case <- timeout :
459+ return errors .New ("timeout waiting for Start() to initialize" )
460+ case <- ticker .C :
461+ }
462+ }
446463}
You can’t perform that action at this time.
0 commit comments