mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
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
This commit is contained in:
parent
8a56b6b27c
commit
615d1d6336
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user