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
10f72be5
Commit
10f72be5
authored
Dec 21, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support set user with `--ssh-user` flag when running remote node e2e.
parent
db867c0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
e2e-node-jenkins.sh
test/e2e_node/jenkins/e2e-node-jenkins.sh
+3
-3
template.properties
test/e2e_node/jenkins/template.properties
+2
-0
ssh.go
test/e2e_node/remote/ssh.go
+8
-2
No files found.
test/e2e_node/jenkins/e2e-node-jenkins.sh
View file @
10f72be5
...
@@ -41,9 +41,9 @@ TIMEOUT=${TIMEOUT:-"45m"}
...
@@ -41,9 +41,9 @@ TIMEOUT=${TIMEOUT:-"45m"}
mkdir
-p
${
ARTIFACTS
}
mkdir
-p
${
ARTIFACTS
}
go run
test
/e2e_node/runner/remote/run_remote.go
--logtostderr
--vmodule
=
*
=
4
--ssh-env
=
"gce"
\
go run
test
/e2e_node/runner/remote/run_remote.go
--logtostderr
--vmodule
=
*
=
4
\
--
zone
=
"
$GCE_ZONE
"
--project
=
"
$GCE_PROJECT
"
--hosts
=
"
$GCE_HOSTS
"
\
--
ssh-env
=
"gce"
--ssh-user
=
"
$GCE_USER
"
--zone
=
"
$GCE_ZONE
"
--project
=
"
$GCE_PROJECT
"
\
--images
=
"
$GCE_IMAGES
"
--image-project
=
"
$GCE_IMAGE_PROJECT
"
\
--
hosts
=
"
$GCE_HOSTS
"
--
images
=
"
$GCE_IMAGES
"
--image-project
=
"
$GCE_IMAGE_PROJECT
"
\
--image-config-file
=
"
$GCE_IMAGE_CONFIG_PATH
"
--cleanup
=
"
$CLEANUP
"
\
--image-config-file
=
"
$GCE_IMAGE_CONFIG_PATH
"
--cleanup
=
"
$CLEANUP
"
\
--results-dir
=
"
$ARTIFACTS
"
--ginkgo-flags
=
"--nodes=
$PARALLELISM
$GINKGO_FLAGS
"
\
--results-dir
=
"
$ARTIFACTS
"
--ginkgo-flags
=
"--nodes=
$PARALLELISM
$GINKGO_FLAGS
"
\
--test-timeout
=
"
$TIMEOUT
"
--test_args
=
"
$TEST_ARGS
--kubelet-flags=
\"
$KUBELET_ARGS
\"
"
\
--test-timeout
=
"
$TIMEOUT
"
--test_args
=
"
$TEST_ARGS
--kubelet-flags=
\"
$KUBELET_ARGS
\"
"
\
...
...
test/e2e_node/jenkins/template.properties
View file @
10f72be5
# Copy this file to your home directory and modify
# Copy this file to your home directory and modify
# User used on the gce instances to run the test.
GCE_USER
=
# Path to a yaml or json file describing images to run or empty
# Path to a yaml or json file describing images to run or empty
GCE_IMAGE_CONFIG_PATH
=
GCE_IMAGE_CONFIG_PATH
=
# Names of gce hosts to test against (must be resolvable) or empty
# Names of gce hosts to test against (must be resolvable) or empty
...
...
test/e2e_node/remote/ssh.go
View file @
10f72be5
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
var
sshOptions
=
flag
.
String
(
"ssh-options"
,
""
,
"Commandline options passed to ssh."
)
var
sshOptions
=
flag
.
String
(
"ssh-options"
,
""
,
"Commandline options passed to ssh."
)
var
sshEnv
=
flag
.
String
(
"ssh-env"
,
""
,
"Use predefined ssh options for environment. Options: gce"
)
var
sshEnv
=
flag
.
String
(
"ssh-env"
,
""
,
"Use predefined ssh options for environment. Options: gce"
)
var
sshUser
=
flag
.
String
(
"ssh-user"
,
""
,
"Use predefined user for ssh."
)
var
sshOptionsMap
map
[
string
]
string
var
sshOptionsMap
map
[
string
]
string
...
@@ -53,13 +54,18 @@ func AddHostnameIp(hostname, ip string) {
...
@@ -53,13 +54,18 @@ func AddHostnameIp(hostname, ip string) {
hostnameIpOverrides
.
m
[
hostname
]
=
ip
hostnameIpOverrides
.
m
[
hostname
]
=
ip
}
}
// GetHostnameOrIp converts hostname into ip and apply user if necessary.
func
GetHostnameOrIp
(
hostname
string
)
string
{
func
GetHostnameOrIp
(
hostname
string
)
string
{
hostnameIpOverrides
.
RLock
()
hostnameIpOverrides
.
RLock
()
defer
hostnameIpOverrides
.
RUnlock
()
defer
hostnameIpOverrides
.
RUnlock
()
host
:=
hostname
if
ip
,
found
:=
hostnameIpOverrides
.
m
[
hostname
];
found
{
if
ip
,
found
:=
hostnameIpOverrides
.
m
[
hostname
];
found
{
return
ip
host
=
ip
}
}
return
hostname
if
*
sshUser
!=
""
{
host
=
fmt
.
Sprintf
(
"%s@%s"
,
*
sshUser
,
host
)
}
return
host
}
}
// getSSHCommand handles proper quoting so that multiple commands are executed in the same shell over ssh
// getSSHCommand handles proper quoting so that multiple commands are executed in the same shell over ssh
...
...
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