Commit d76d2442 authored by Euan Kemp's avatar Euan Kemp

test/e2e/addon_update: Respect KUBE_SSH_USER

parent 739d0a61
...@@ -351,8 +351,8 @@ func waitForReplicationControllerInAddonTest(c *client.Client, addonNamespace, n ...@@ -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) { ...@@ -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)},
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment