mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Read ssh username from env variable
Signed-off-by: Harshal Patil <harpatil@redhat.com>
This commit is contained in:
parent
ebbbc57540
commit
9d5ca30b76
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user