Merge pull request #9905 from justinsb/aws_ssh_user

Don't assume we always SSH as the current user
This commit is contained in:
Jeff Lowdermilk
2015-06-22 10:37:07 -07:00
3 changed files with 117 additions and 8 deletions

View File

@@ -1161,7 +1161,9 @@ func SSH(cmd, host, provider string) (string, string, int, error) {
return "", "", 0, fmt.Errorf("error getting signer for provider %s: '%v'", provider, err)
}
return util.RunSSHCommand(cmd, host, signer)
user := os.Getenv("KUBE_SSH_USER")
// RunSSHCommand will default to Getenv("USER") if user == ""
return util.RunSSHCommand(cmd, user, host, signer)
}
// getSigner returns an ssh.Signer for the provider ("gce", etc.) that can be