Allow a single SSH key to be used in all providers

Support KUBE_SSH_KEY_PATH as a single environment variable that if specified ignores the provider specific settinsg and loads the SSH private key from the provided path. Makes it much easier to specify a consistent signer across providers.
parent c6ae7ae3
......@@ -31,6 +31,11 @@ import (
// GetSigner returns an ssh.Signer for the provider ("gce", etc.) that can be
// used to SSH to their nodes.
func GetSigner(provider string) (ssh.Signer, error) {
// honor a consistent SSH key across all providers
if path := os.Getenv("KUBE_SSH_KEY_PATH"); len(path) > 0 {
return sshutil.MakePrivateKeySignerFromFile(path)
}
// Select the key itself to use. When implementing more providers here,
// please also add them to any SSH tests that are disabled because of signer
// support.
......
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