From 615d1d633630d7bc25608c055894b74a9f540555 Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Tue, 13 Sep 2016 11:23:55 +0300 Subject: [PATCH] Allow to use GetSigner with vagrant provider In order to run tests that require ssh access to a node on vagrant we need to provide path to private ssh key. Now it will be possible to do using VAGRANT_SSH_KEY environment variable Change-Id: Ic5fe0037edd46d0db3b8036ad7fc03cf1ea07574 --- test/e2e/framework/util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 7b9fbc3f82e..fe7d7fa374d 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -4098,6 +4098,12 @@ func GetSigner(provider string) (ssh.Signer, error) { } // Otherwise revert to home dir keyfile = "kube_aws_rsa" + case "vagrant": + keyfile := os.Getenv("VAGRANT_SSH_KEY") + if len(keyfile) != 0 { + return sshutil.MakePrivateKeySignerFromFile(keyfile) + } + return nil, fmt.Errorf("VAGRANT_SSH_KEY env variable should be provided") default: return nil, fmt.Errorf("GetSigner(...) not implemented for %s", provider) }