mirror of https://github.com/kubernetes/kops.git
Merge pull request #11065 from rifelpet/kubetest2
Kubetest2 - Add GCE default SSH key values from prow jobs
This commit is contained in:
commit
cad169e1d2
|
|
@ -61,13 +61,25 @@ func (d *deployer) initialize() error {
|
||||||
d.KopsBinaryPath = binaryPath
|
d.KopsBinaryPath = binaryPath
|
||||||
d.KopsBaseURL = baseURL
|
d.KopsBaseURL = baseURL
|
||||||
}
|
}
|
||||||
// These environment variables are defined by the "preset-aws-ssh" prow preset
|
switch d.CloudProvider {
|
||||||
// https://github.com/kubernetes/test-infra/blob/3d3b325c98b739b526ba5d93ce21c90a05e1f46d/config/prow/config.yaml#L653-L670
|
case "aws":
|
||||||
if d.SSHPrivateKeyPath == "" {
|
// These environment variables are defined by the "preset-aws-ssh" prow preset
|
||||||
d.SSHPrivateKeyPath = os.Getenv("AWS_SSH_PRIVATE_KEY_FILE")
|
// https://github.com/kubernetes/test-infra/blob/3d3b325c98b739b526ba5d93ce21c90a05e1f46d/config/prow/config.yaml#L653-L670
|
||||||
}
|
if d.SSHPrivateKeyPath == "" {
|
||||||
if d.SSHPublicKeyPath == "" {
|
d.SSHPrivateKeyPath = os.Getenv("AWS_SSH_PRIVATE_KEY_FILE")
|
||||||
d.SSHPublicKeyPath = os.Getenv("AWS_SSH_PUBLIC_KEY_FILE")
|
}
|
||||||
|
if d.SSHPublicKeyPath == "" {
|
||||||
|
d.SSHPublicKeyPath = os.Getenv("AWS_SSH_PUBLIC_KEY_FILE")
|
||||||
|
}
|
||||||
|
case "gce":
|
||||||
|
// These environment variables are defined by the "preset-k8s-ssh" prow preset
|
||||||
|
// https://github.com/kubernetes/test-infra/blob/432c6e7dca38f0785901a6159275524cec369c4a/config/prow/config.yaml#L639-L656
|
||||||
|
if d.SSHPrivateKeyPath == "" {
|
||||||
|
d.SSHPrivateKeyPath = os.Getenv("JENKINS_GCE_SSH_PRIVATE_KEY_FILE")
|
||||||
|
}
|
||||||
|
if d.SSHPublicKeyPath == "" {
|
||||||
|
d.SSHPublicKeyPath = os.Getenv("JENKINS_GCE_SSH_PUBLIC_KEY_FILE")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if d.SSHUser == "" {
|
if d.SSHUser == "" {
|
||||||
d.SSHUser = os.Getenv("KUBE_SSH_USER")
|
d.SSHUser = os.Getenv("KUBE_SSH_USER")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue