Decrease connection timeout when dumping logs from instances

This is currently over 2 minutes. This change should speed up the end of tests when SSH isn't available.
This commit is contained in:
Peter Rifel 2021-09-22 21:09:13 -05:00
parent defcdedb68
commit a6d47b6002
No known key found for this signature in database
GPG Key ID: BC6469E5B16DB2B6
1 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
@ -411,7 +412,9 @@ var _ sshClientFactory = &sshClientFactoryImplementation{}
// Dial implements sshClientFactory::Dial // Dial implements sshClientFactory::Dial
func (f *sshClientFactoryImplementation) Dial(ctx context.Context, host string) (sshClient, error) { func (f *sshClientFactoryImplementation) Dial(ctx context.Context, host string) (sshClient, error) {
addr := host + ":22" addr := host + ":22"
d := net.Dialer{} d := net.Dialer{
Timeout: 15 * time.Second,
}
conn, err := d.DialContext(ctx, "tcp", addr) conn, err := d.DialContext(ctx, "tcp", addr)
if err != nil { if err != nil {
return nil, err return nil, err