diff --git a/test/e2e_node/remote/ssh.go b/test/e2e_node/remote/ssh.go index f1ff1a3b765..e1d7cbb4ed3 100644 --- a/test/e2e_node/remote/ssh.go +++ b/test/e2e_node/remote/ssh.go @@ -19,6 +19,7 @@ package remote import ( "flag" "fmt" + "os" "os/exec" "os/user" "strings" @@ -68,6 +69,11 @@ func GetHostnameOrIP(hostname string) string { if ip, found := hostnameIPOverrides.m[hostname]; found { host = ip } + + if *sshUser == "" { + *sshUser = os.Getenv("KUBE_SSH_USER") + } + if *sshUser != "" { host = fmt.Sprintf("%s@%s", *sshUser, host) }