Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
82cefcd9
Unverified
Commit
82cefcd9
authored
Dec 05, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68753 from johnSchnake/68687-consistentSSHKeyHandling
Make SSH path handling consistent across providers during e2e
parents
3952199c
266080e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
util.go
test/e2e/framework/util.go
+16
-17
No files found.
test/e2e/framework/util.go
View file @
82cefcd9
...
@@ -3601,44 +3601,43 @@ func DeletePodOrFail(c clientset.Interface, ns, name string) {
...
@@ -3601,44 +3601,43 @@ func DeletePodOrFail(c clientset.Interface, ns, name string) {
// GetSigner returns an ssh.Signer for the provider ("gce", etc.) that can be
// GetSigner returns an ssh.Signer for the provider ("gce", etc.) that can be
// used to SSH to their nodes.
// used to SSH to their nodes.
func
GetSigner
(
provider
string
)
(
ssh
.
Signer
,
error
)
{
func
GetSigner
(
provider
string
)
(
ssh
.
Signer
,
error
)
{
// Get the directory in which SSH keys are located.
keydir
:=
filepath
.
Join
(
os
.
Getenv
(
"HOME"
),
".ssh"
)
// Select the key itself to use. When implementing more providers here,
// 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
// please also add them to any SSH tests that are disabled because of signer
// support.
// support.
keyfile
:=
""
keyfile
:=
""
key
:=
""
switch
provider
{
switch
provider
{
case
"gce"
,
"gke"
,
"kubemark"
:
case
"gce"
,
"gke"
,
"kubemark"
:
keyfile
=
"google_compute_engine"
keyfile
=
os
.
Getenv
(
"GCE_SSH_KEY"
)
if
keyfile
==
""
{
keyfile
=
"google_compute_engine"
}
case
"aws"
:
case
"aws"
:
// If there is an env. variable override, use that.
keyfile
=
os
.
Getenv
(
"AWS_SSH_KEY"
)
aws_keyfile
:=
os
.
Getenv
(
"AWS_SSH_KEY"
)
if
keyfile
==
""
{
if
len
(
aws_keyfile
)
!=
0
{
keyfile
=
"kube_aws_rsa"
return
sshutil
.
MakePrivateKeySignerFromFile
(
aws_keyfile
)
}
}
// Otherwise revert to home dir
keyfile
=
"kube_aws_rsa"
case
"local"
,
"vsphere"
:
case
"local"
,
"vsphere"
:
keyfile
=
os
.
Getenv
(
"LOCAL_SSH_KEY"
)
// maybe?
keyfile
=
os
.
Getenv
(
"LOCAL_SSH_KEY"
)
if
len
(
keyfile
)
==
0
{
if
keyfile
==
""
{
keyfile
=
"id_rsa"
keyfile
=
"id_rsa"
}
}
case
"skeleton"
:
case
"skeleton"
:
keyfile
=
os
.
Getenv
(
"KUBE_SSH_KEY"
)
keyfile
=
os
.
Getenv
(
"KUBE_SSH_KEY"
)
if
len
(
keyfile
)
==
0
{
if
keyfile
==
""
{
keyfile
=
"id_rsa"
keyfile
=
"id_rsa"
}
}
default
:
default
:
return
nil
,
fmt
.
Errorf
(
"GetSigner(...) not implemented for %s"
,
provider
)
return
nil
,
fmt
.
Errorf
(
"GetSigner(...) not implemented for %s"
,
provider
)
}
}
if
len
(
key
)
==
0
{
// Respect absolute paths for keys given by user, fallback to assuming
key
=
filepath
.
Join
(
keydir
,
keyfile
)
// relative paths are in ~/.ssh
if
!
filepath
.
IsAbs
(
keyfile
)
{
keydir
:=
filepath
.
Join
(
os
.
Getenv
(
"HOME"
),
".ssh"
)
keyfile
=
filepath
.
Join
(
keydir
,
keyfile
)
}
}
return
sshutil
.
MakePrivateKeySignerFromFile
(
key
)
return
sshutil
.
MakePrivateKeySignerFromFile
(
key
file
)
}
}
// CheckPodsRunningReady returns whether all pods whose names are listed in
// CheckPodsRunningReady returns whether all pods whose names are listed in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment