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
86936539
Commit
86936539
authored
Oct 03, 2017
by
Sen Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a flag to customize config relative dir
parent
41568a06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
run_remote.go
test/e2e_node/runner/remote/run_remote.go
+14
-3
No files found.
test/e2e_node/runner/remote/run_remote.go
View file @
86936539
...
...
@@ -28,6 +28,7 @@ import (
"net/http"
"os"
"os/exec"
"path/filepath"
"regexp"
"sort"
"strings"
...
...
@@ -50,6 +51,7 @@ var instanceNamePrefix = flag.String("instance-name-prefix", "", "prefix for ins
var
zone
=
flag
.
String
(
"zone"
,
""
,
"gce zone the hosts live in"
)
var
project
=
flag
.
String
(
"project"
,
""
,
"gce project the hosts live in"
)
var
imageConfigFile
=
flag
.
String
(
"image-config-file"
,
""
,
"yaml file describing images to run"
)
var
imageConfigDir
=
flag
.
String
(
"image-config-dir"
,
""
,
"(optional)path to image config files"
)
var
imageProject
=
flag
.
String
(
"image-project"
,
""
,
"gce project the hosts live in"
)
var
images
=
flag
.
String
(
"images"
,
""
,
"images to test"
)
var
hosts
=
flag
.
String
(
"hosts"
,
""
,
"hosts to test"
)
...
...
@@ -177,8 +179,13 @@ func main() {
images
:
make
(
map
[
string
]
internalGCEImage
),
}
if
*
imageConfigFile
!=
""
{
configPath
:=
*
imageConfigFile
if
*
imageConfigDir
!=
""
{
configPath
=
filepath
.
Join
(
*
imageConfigDir
,
*
imageConfigFile
)
}
// parse images
imageConfigData
,
err
:=
ioutil
.
ReadFile
(
*
imageConfigFile
)
imageConfigData
,
err
:=
ioutil
.
ReadFile
(
configPath
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Could not read image config file provided: %v"
,
err
)
}
...
...
@@ -694,9 +701,13 @@ func parseInstanceMetadata(str string) map[string]string {
glog
.
Fatalf
(
"Invalid instance metadata: %q"
,
s
)
continue
}
v
,
err
:=
ioutil
.
ReadFile
(
kp
[
1
])
metaPath
:=
kp
[
1
]
if
*
imageConfigDir
!=
""
{
metaPath
=
filepath
.
Join
(
*
imageConfigDir
,
metaPath
)
}
v
,
err
:=
ioutil
.
ReadFile
(
metaPath
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to read metadata file %q: %v"
,
kp
[
1
]
,
err
)
glog
.
Fatalf
(
"Failed to read metadata file %q: %v"
,
metaPath
,
err
)
continue
}
metadata
[
kp
[
0
]]
=
string
(
v
)
...
...
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