Commit 84db106e authored by k8s-merge-robot's avatar k8s-merge-robot

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
parents 761fc002 d76d2442
......@@ -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)},
}
......
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