Merge pull request #32560 from dshulyak/enable_signer_for_vagrant

Automatic merge from submit-queue

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
This commit is contained in:
Kubernetes Submit Queue 2016-09-14 05:35:55 -07:00 committed by GitHub
commit b77e2728d8

View File

@ -4113,6 +4113,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)
}