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
4b7764b5
Commit
4b7764b5
authored
Feb 17, 2016
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e: log events, pod/node info when kube-system pods fail to start
parent
ef505d8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
14 deletions
+23
-14
e2e.go
test/e2e/e2e.go
+5
-0
framework.go
test/e2e/framework.go
+1
-14
util.go
test/e2e/util.go
+17
-0
No files found.
test/e2e/e2e.go
View file @
4b7764b5
...
...
@@ -39,6 +39,8 @@ import (
gcecloud
"k8s.io/kubernetes/pkg/cloudprovider/providers/gce"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/runtime"
.
"github.com/onsi/gomega"
)
const
(
...
...
@@ -180,6 +182,9 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// test pods from running, and tests that ensure all pods are running and
// ready will fail).
if
err
:=
waitForPodsRunningReady
(
api
.
NamespaceSystem
,
testContext
.
MinStartupPods
,
podStartupTimeout
);
err
!=
nil
{
c
,
err
:=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
dumpAllNamespaceInfo
(
c
,
api
.
NamespaceSystem
)
Failf
(
"Error waiting for all pods to be running and ready: %v"
,
err
)
}
...
...
test/e2e/framework.go
View file @
4b7764b5
...
...
@@ -161,20 +161,7 @@ func (f *Framework) afterEach() {
// Print events if the test failed.
if
CurrentGinkgoTestDescription
()
.
Failed
{
By
(
fmt
.
Sprintf
(
"Collecting events from namespace %q."
,
f
.
Namespace
.
Name
))
events
,
err
:=
f
.
Client
.
Events
(
f
.
Namespace
.
Name
)
.
List
(
api
.
ListOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
e
:=
range
events
.
Items
{
Logf
(
"event for %v: %v %v: %v"
,
e
.
InvolvedObject
.
Name
,
e
.
Source
,
e
.
Reason
,
e
.
Message
)
}
// Note that we don't wait for any cleanup to propagate, which means
// that if you delete a bunch of pods right before ending your test,
// you may or may not see the killing/deletion/cleanup events.
dumpAllPodInfo
(
f
.
Client
)
dumpAllNodeInfo
(
f
.
Client
)
dumpAllNamespaceInfo
(
f
.
Client
,
f
.
Namespace
.
Name
)
}
summaries
:=
make
([]
TestDataSummary
,
0
)
...
...
test/e2e/util.go
View file @
4b7764b5
...
...
@@ -1806,6 +1806,23 @@ func dumpPodDebugInfo(c *client.Client, pods []*api.Pod) {
dumpNodeDebugInfo
(
c
,
badNodes
.
List
())
}
func
dumpAllNamespaceInfo
(
c
*
client
.
Client
,
namespace
string
)
{
By
(
fmt
.
Sprintf
(
"Collecting events from namespace %q."
,
namespace
))
events
,
err
:=
c
.
Events
(
namespace
)
.
List
(
api
.
ListOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
e
:=
range
events
.
Items
{
Logf
(
"event for %v: %v %v: %v"
,
e
.
InvolvedObject
.
Name
,
e
.
Source
,
e
.
Reason
,
e
.
Message
)
}
// Note that we don't wait for any cleanup to propagate, which means
// that if you delete a bunch of pods right before ending your test,
// you may or may not see the killing/deletion/cleanup events.
dumpAllPodInfo
(
c
)
dumpAllNodeInfo
(
c
)
}
func
dumpAllPodInfo
(
c
*
client
.
Client
)
{
pods
,
err
:=
c
.
Pods
(
""
)
.
List
(
api
.
ListOptions
{})
if
err
!=
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