test/e2e/addon_update: Respect KUBE_SSH_USER

pull/6/head
Euan Kemp 2016-04-21 15:01:26 -07:00
parent 739d0a61d3
commit d76d2442e7
1 changed files with 7 additions and 3 deletions

View File

@ -351,8 +351,8 @@ func waitForReplicationControllerInAddonTest(c *client.Client, addonNamespace, n
framework.ExpectNoError(framework.WaitForReplicationController(c, addonNamespace, name, exist, addonTestPollInterval, addonTestPollTimeout)) framework.ExpectNoError(framework.WaitForReplicationController(c, addonNamespace, name, exist, addonTestPollInterval, addonTestPollTimeout))
} }
// TODO marekbiskup 2015-06-11: merge the ssh code into pkg/util/ssh.go after // TODO use the framework.SSH code, either adding an SCP to it or copying files
// kubernetes v1.0 is released. In particular the code of sshExec. // differently.
func getMasterSSHClient() (*ssh.Client, error) { func getMasterSSHClient() (*ssh.Client, error) {
// Get a signer for the provider. // Get a signer for the provider.
signer, err := framework.GetSigner(framework.TestContext.Provider) signer, err := framework.GetSigner(framework.TestContext.Provider)
@ -360,8 +360,12 @@ func getMasterSSHClient() (*ssh.Client, error) {
return nil, fmt.Errorf("error getting signer for provider %s: '%v'", framework.TestContext.Provider, err) return nil, fmt.Errorf("error getting signer for provider %s: '%v'", framework.TestContext.Provider, err)
} }
sshUser := os.Getenv("KUBE_SSH_USER")
if sshUser == "" {
sshUser = os.Getenv("USER")
}
config := &ssh.ClientConfig{ config := &ssh.ClientConfig{
User: os.Getenv("USER"), User: sshUser,
Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)},
} }