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
1aff115f
Commit
1aff115f
authored
Oct 11, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make logging function injectable in RCConfig
parent
ead65fc2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
daemon_restart.go
test/e2e/daemon_restart.go
+1
-1
density.go
test/e2e/density.go
+2
-2
e2e.go
test/e2e/e2e.go
+2
-2
framework.go
test/e2e/framework/framework.go
+3
-3
kubelet_stats.go
test/e2e/framework/kubelet_stats.go
+2
-2
metrics_util.go
test/e2e/framework/metrics_util.go
+1
-1
util.go
test/e2e/framework/util.go
+0
-0
No files found.
test/e2e/daemon_restart.go
View file @
1aff115f
...
...
@@ -312,7 +312,7 @@ var _ = framework.KubeDescribe("DaemonRestart [Disruptive]", func() {
}
postRestarts
,
badNodes
:=
getContainerRestarts
(
f
.
Client
,
ns
,
labelSelector
)
if
postRestarts
!=
preRestarts
{
framework
.
DumpNodeDebugInfo
(
f
.
Client
,
badNodes
)
framework
.
DumpNodeDebugInfo
(
f
.
Client
,
badNodes
,
framework
.
Logf
)
framework
.
Failf
(
"Net container restart count went from %v -> %v after kubelet restart on nodes %v
\n\n
%+v"
,
preRestarts
,
postRestarts
,
badNodes
,
tracker
)
}
})
...
...
test/e2e/density.go
View file @
1aff115f
...
...
@@ -172,11 +172,11 @@ func logPodStartupStatus(c *client.Client, expectedPods int, ns string, observed
case
<-
ticker
.
C
:
pods
:=
podStore
.
List
()
startupStatus
:=
framework
.
ComputeRCStartupStatus
(
pods
,
expectedPods
)
startupStatus
.
Print
(
"Density"
)
framework
.
Logf
(
startupStatus
.
String
(
"Density"
)
)
case
<-
stopCh
:
pods
:=
podStore
.
List
()
startupStatus
:=
framework
.
ComputeRCStartupStatus
(
pods
,
expectedPods
)
startupStatus
.
Print
(
"Density"
)
framework
.
Logf
(
startupStatus
.
String
(
"Density"
)
)
return
}
}
...
...
test/e2e/e2e.go
View file @
1aff115f
...
...
@@ -123,7 +123,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
podStartupTimeout
:=
framework
.
TestContext
.
SystemPodsStartupTimeout
if
err
:=
framework
.
WaitForPodsRunningReady
(
c
,
api
.
NamespaceSystem
,
int32
(
framework
.
TestContext
.
MinStartupPods
),
podStartupTimeout
,
framework
.
ImagePullerLabels
);
err
!=
nil
{
framework
.
DumpAllNamespaceInfo
(
c
,
clientset
,
api
.
NamespaceSystem
)
framework
.
LogFailedContainers
(
c
,
api
.
NamespaceSystem
)
framework
.
LogFailedContainers
(
c
,
api
.
NamespaceSystem
,
framework
.
Logf
)
framework
.
RunKubernetesServiceTestContainer
(
c
,
api
.
NamespaceDefault
)
framework
.
Failf
(
"Error waiting for all pods to be running and ready: %v"
,
err
)
}
...
...
@@ -139,7 +139,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Dump the output of the nethealth containers only once per run
if
framework
.
TestContext
.
DumpLogsOnFailure
{
framework
.
Logf
(
"Dumping network health container logs from all nodes"
)
framework
.
LogContainersInPodsWithLabels
(
c
,
api
.
NamespaceSystem
,
framework
.
ImagePullerLabels
,
"nethealth"
)
framework
.
LogContainersInPodsWithLabels
(
c
,
api
.
NamespaceSystem
,
framework
.
ImagePullerLabels
,
"nethealth"
,
framework
.
Logf
)
}
// Reference common test to make the import valid.
...
...
test/e2e/framework/framework.go
View file @
1aff115f
...
...
@@ -377,16 +377,16 @@ func (f *Framework) AfterEach() {
// Pass both unversioned client and and versioned clientset, till we have removed all uses of the unversioned client.
DumpAllNamespaceInfo
(
f
.
Client
,
f
.
ClientSet_1_5
,
f
.
Namespace
.
Name
)
By
(
fmt
.
Sprintf
(
"Dumping a list of prepulled images on each node"
))
LogContainersInPodsWithLabels
(
f
.
Client
,
api
.
NamespaceSystem
,
ImagePullerLabels
,
"image-puller"
)
LogContainersInPodsWithLabels
(
f
.
Client
,
api
.
NamespaceSystem
,
ImagePullerLabels
,
"image-puller"
,
Logf
)
if
f
.
federated
{
// Dump federation events in federation namespace.
DumpEventsInNamespace
(
func
(
opts
v1
.
ListOptions
,
ns
string
)
(
*
v1
.
EventList
,
error
)
{
return
f
.
FederationClientset_1_5
.
Core
()
.
Events
(
ns
)
.
List
(
opts
)
},
f
.
FederationNamespace
.
Name
)
// Print logs of federation control plane pods (federation-apiserver and federation-controller-manager)
LogPodsWithLabels
(
f
.
Client
,
"federation"
,
map
[
string
]
string
{
"app"
:
"federated-cluster"
})
LogPodsWithLabels
(
f
.
Client
,
"federation"
,
map
[
string
]
string
{
"app"
:
"federated-cluster"
}
,
Logf
)
// Print logs of kube-dns pod
LogPodsWithLabels
(
f
.
Client
,
"kube-system"
,
map
[
string
]
string
{
"k8s-app"
:
"kube-dns"
})
LogPodsWithLabels
(
f
.
Client
,
"kube-system"
,
map
[
string
]
string
{
"k8s-app"
:
"kube-dns"
}
,
Logf
)
}
}
...
...
test/e2e/framework/kubelet_stats.go
View file @
1aff115f
...
...
@@ -256,7 +256,7 @@ func getNodeRuntimeOperationErrorRate(c *client.Client, node string) (NodeRuntim
}
// HighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.
func
HighLatencyKubeletOperations
(
c
*
client
.
Client
,
threshold
time
.
Duration
,
nodeName
string
)
(
KubeletLatencyMetrics
,
error
)
{
func
HighLatencyKubeletOperations
(
c
*
client
.
Client
,
threshold
time
.
Duration
,
nodeName
string
,
logFunc
func
(
fmt
string
,
args
...
interface
{})
)
(
KubeletLatencyMetrics
,
error
)
{
ms
,
err
:=
getKubeletMetrics
(
c
,
nodeName
)
if
err
!=
nil
{
return
KubeletLatencyMetrics
{},
err
...
...
@@ -264,7 +264,7 @@ func HighLatencyKubeletOperations(c *client.Client, threshold time.Duration, nod
latencyMetrics
:=
GetKubeletLatencyMetrics
(
ms
)
sort
.
Sort
(
latencyMetrics
)
var
badMetrics
KubeletLatencyMetrics
Logf
(
"
\n
Latency metrics for node %v"
,
nodeName
)
logFunc
(
"
\n
Latency metrics for node %v"
,
nodeName
)
for
_
,
m
:=
range
latencyMetrics
{
if
m
.
Latency
>
threshold
{
badMetrics
=
append
(
badMetrics
,
m
)
...
...
test/e2e/framework/metrics_util.go
View file @
1aff115f
...
...
@@ -463,7 +463,7 @@ func LogSuspiciousLatency(latencyData []PodLatencyData, latencyDataLag []PodLate
}
for
_
,
l
:=
range
latencyData
{
if
l
.
Latency
>
NodeStartupThreshold
{
HighLatencyKubeletOperations
(
c
,
1
*
time
.
Second
,
l
.
Node
)
HighLatencyKubeletOperations
(
c
,
1
*
time
.
Second
,
l
.
Node
,
Logf
)
}
}
Logf
(
"Approx throughput: %v pods/min"
,
...
...
test/e2e/framework/util.go
View file @
1aff115f
This diff is collapsed.
Click to expand it.
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