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
61703787
Commit
61703787
authored
Apr 04, 2017
by
Maru Newby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configurably skip creation of namespace on e2e setup
parent
5ef8148b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
framework.go
test/e2e/framework/framework.go
+20
-14
No files found.
test/e2e/framework/framework.go
View file @
61703787
...
@@ -64,7 +64,8 @@ type Framework struct {
...
@@ -64,7 +64,8 @@ type Framework struct {
StagingClient
*
staging
.
Clientset
StagingClient
*
staging
.
Clientset
ClientPool
dynamic
.
ClientPool
ClientPool
dynamic
.
ClientPool
Namespace
*
v1
.
Namespace
// Every test has at least one namespace
SkipNamespaceCreation
bool
// Whether to skip creating a namespace
Namespace
*
v1
.
Namespace
// Every test has at least one namespace unless creation is skipped
namespacesToDelete
[]
*
v1
.
Namespace
// Some tests have more than one.
namespacesToDelete
[]
*
v1
.
Namespace
// Some tests have more than one.
NamespaceDeletionTimeout
time
.
Duration
NamespaceDeletionTimeout
time
.
Duration
...
@@ -181,23 +182,26 @@ func (f *Framework) BeforeEach() {
...
@@ -181,23 +182,26 @@ func (f *Framework) BeforeEach() {
f
.
ClientPool
=
dynamic
.
NewClientPool
(
config
,
api
.
Registry
.
RESTMapper
(),
dynamic
.
LegacyAPIPathResolverFunc
)
f
.
ClientPool
=
dynamic
.
NewClientPool
(
config
,
api
.
Registry
.
RESTMapper
(),
dynamic
.
LegacyAPIPathResolverFunc
)
}
}
By
(
"Building a namespace api object"
)
if
!
f
.
SkipNamespaceCreation
{
namespace
,
err
:=
f
.
CreateNamespace
(
f
.
BaseName
,
map
[
string
]
string
{
By
(
"Building a namespace api object"
)
"e2e-framework"
:
f
.
BaseName
,
namespace
,
err
:=
f
.
CreateNamespace
(
f
.
BaseName
,
map
[
string
]
string
{
})
"e2e-framework"
:
f
.
BaseName
,
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
f
.
Namespace
=
namespace
f
.
Namespace
=
namespace
if
TestContext
.
VerifyServiceAccount
{
if
TestContext
.
VerifyServiceAccount
{
By
(
"Waiting for a default service account to be provisioned in namespace"
)
By
(
"Waiting for a default service account to be provisioned in namespace"
)
err
=
WaitForDefaultServiceAccountInNamespace
(
f
.
ClientSet
,
namespace
.
Name
)
err
=
WaitForDefaultServiceAccountInNamespace
(
f
.
ClientSet
,
namespace
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
else
{
}
else
{
Logf
(
"Skipping waiting for service account"
)
Logf
(
"Skipping waiting for service account"
)
}
}
}
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
var
err
error
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
f
.
ClientSet
,
ResourceGathererOptions
{
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
f
.
ClientSet
,
ResourceGathererOptions
{
inKubemark
:
ProviderIs
(
"kubemark"
),
inKubemark
:
ProviderIs
(
"kubemark"
),
masterOnly
:
TestContext
.
GatherKubeSystemResourceUsageData
==
"master"
,
masterOnly
:
TestContext
.
GatherKubeSystemResourceUsageData
==
"master"
,
...
@@ -274,7 +278,9 @@ func (f *Framework) AfterEach() {
...
@@ -274,7 +278,9 @@ func (f *Framework) AfterEach() {
// Print events if the test failed.
// Print events if the test failed.
if
CurrentGinkgoTestDescription
()
.
Failed
&&
TestContext
.
DumpLogsOnFailure
{
if
CurrentGinkgoTestDescription
()
.
Failed
&&
TestContext
.
DumpLogsOnFailure
{
// Pass both unversioned client and and versioned clientset, till we have removed all uses of the unversioned client.
// Pass both unversioned client and and versioned clientset, till we have removed all uses of the unversioned client.
DumpAllNamespaceInfo
(
f
.
ClientSet
,
f
.
Namespace
.
Name
)
if
!
f
.
SkipNamespaceCreation
{
DumpAllNamespaceInfo
(
f
.
ClientSet
,
f
.
Namespace
.
Name
)
}
By
(
fmt
.
Sprintf
(
"Dumping a list of prepulled images on each node"
))
By
(
fmt
.
Sprintf
(
"Dumping a list of prepulled images on each node"
))
LogContainersInPodsWithLabels
(
f
.
ClientSet
,
metav1
.
NamespaceSystem
,
ImagePullerLabels
,
"image-puller"
,
Logf
)
LogContainersInPodsWithLabels
(
f
.
ClientSet
,
metav1
.
NamespaceSystem
,
ImagePullerLabels
,
"image-puller"
,
Logf
)
}
}
...
...
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