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
e6321c74
Commit
e6321c74
authored
Feb 22, 2017
by
Michael Taufen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup some of the tarball producing code
parent
2e127111
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
node_e2e.go
test/e2e_node/remote/node_e2e.go
+30
-14
No files found.
test/e2e_node/remote/node_e2e.go
View file @
e6321c74
...
...
@@ -29,6 +29,8 @@ import (
"k8s.io/kubernetes/test/e2e_node/builder"
)
const
localCOSMounterPath
=
"cluster/gce/gci/mounter/mounter"
// NodeE2ERemote contains the specific functions in the node e2e test suite.
type
NodeE2ERemote
struct
{}
...
...
@@ -37,8 +39,6 @@ func InitNodeE2ERemote() TestSuite {
return
&
NodeE2ERemote
{}
}
const
localCOSMounterPath
=
"cluster/gce/gci/mounter/mounter"
// SetupTestPackage sets up the test package with binaries k8s required for node e2e tests
func
(
n
*
NodeE2ERemote
)
SetupTestPackage
(
tardir
string
)
error
{
// Build the executables
...
...
@@ -66,10 +66,37 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir string) error {
}
// Include the GCI/COS mounter artifacts in the deployed tarball
err
=
tarAddCOSMounter
(
tardir
)
if
err
!=
nil
{
return
err
}
return
nil
}
// dest is relative to the root of the tar
func
tarAddFile
(
tar
,
source
,
dest
string
)
error
{
dir
:=
filepath
.
Dir
(
dest
)
tardir
:=
filepath
.
Join
(
tar
,
dir
)
tardest
:=
filepath
.
Join
(
tar
,
dest
)
out
,
err
:=
exec
.
Command
(
"mkdir"
,
"-p"
,
tardir
)
.
CombinedOutput
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to create archive bin subdir %q, was dest for file %q. Err: %v. Output:
\n
%s"
,
tardir
,
source
,
err
,
out
)
}
out
,
err
=
exec
.
Command
(
"cp"
,
source
,
tardest
)
.
CombinedOutput
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to copy file %q to the archive bin subdir %q. Err: %v. Output:
\n
%s"
,
source
,
tardir
,
err
,
out
)
}
return
nil
}
// Includes the GCI/COS mounter artifacts in the deployed tarball
func
tarAddCOSMounter
(
tar
string
)
error
{
k8sDir
,
err
:=
builder
.
GetK8sRootDir
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Could not find K8s root dir! Err: %v"
,
err
)
}
source
:=
filepath
.
Join
(
k8sDir
,
localCOSMounterPath
)
// Require the GCI/COS mounter script, we want to make sure the remote test runner stays up to date if the mounter file moves
...
...
@@ -77,18 +104,7 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir string) error {
return
fmt
.
Errorf
(
"Could not find GCI/COS mounter script at %q! If this script has been (re)moved, please update the e2e node remote test runner accordingly! Err: %v"
,
source
,
err
)
}
bindir
:=
"cluster/gce/gci/mounter"
bin
:=
"mounter"
destdir
:=
filepath
.
Join
(
tardir
,
bindir
)
dest
:=
filepath
.
Join
(
destdir
,
bin
)
out
,
err
:=
exec
.
Command
(
"mkdir"
,
"-p"
,
filepath
.
Join
(
tardir
,
bindir
))
.
CombinedOutput
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to create directory %q for GCI/COS mounter script. Err: %v. Output:
\n
%s"
,
destdir
,
err
,
out
)
}
out
,
err
=
exec
.
Command
(
"cp"
,
source
,
dest
)
.
CombinedOutput
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to copy GCI/COS mounter script to the archive bin. Err: %v. Output:
\n
%s"
,
err
,
out
)
}
tarAddFile
(
tar
,
source
,
localCOSMounterPath
)
return
nil
}
...
...
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