Merge pull request #24701 from euank/addon-ssh-user

Automatic merge from submit-queue

test/e2e/addon_update: Respect KUBE_SSH_USER

This change makes the e2e tests more consistent as the other ones all already respected this variable.

I didn't do the larger change of re-factoring it to use `framework.SSH` because getting the `scp` portion working there has some significant complexity. If I find time, I'd like to go back and do it since this test needs a little ❤️

cc @yifan-gu, @kubernetes/sig-testing
This commit is contained in:
k8s-merge-robot 2016-05-09 03:31:48 -07:00
commit 84db106ecb

View File

@ -324,8 +324,8 @@ func waitForReplicationControllerInAddonTest(c *client.Client, addonNamespace, n
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
// kubernetes v1.0 is released. In particular the code of sshExec.
// TODO use the framework.SSH code, either adding an SCP to it or copying files
// differently.
func getMasterSSHClient() (*ssh.Client, error) {
// Get a signer for the provider.
signer, err := framework.GetSigner(framework.TestContext.Provider)
@ -333,8 +333,12 @@ func getMasterSSHClient() (*ssh.Client, error) {
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{
User: os.Getenv("USER"),
User: sshUser,
Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)},
}