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
db512fc2
Commit
db512fc2
authored
Jan 05, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log rcs when failed waiting for deployment status in e2e tests
parent
e663dbc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
util.go
test/e2e/util.go
+11
-0
No files found.
test/e2e/util.go
View file @
db512fc2
...
@@ -1939,9 +1939,11 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
...
@@ -1939,9 +1939,11 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
return
false
,
err
return
false
,
err
}
}
if
totalCreated
>
maxCreated
{
if
totalCreated
>
maxCreated
{
logRCsOfDeployment
(
deploymentName
,
oldRCs
,
newRC
)
return
false
,
fmt
.
Errorf
(
"total pods created: %d, more than the max allowed: %d"
,
totalCreated
,
maxCreated
)
return
false
,
fmt
.
Errorf
(
"total pods created: %d, more than the max allowed: %d"
,
totalCreated
,
maxCreated
)
}
}
if
totalAvailable
<
minAvailable
{
if
totalAvailable
<
minAvailable
{
logRCsOfDeployment
(
deploymentName
,
oldRCs
,
newRC
)
return
false
,
fmt
.
Errorf
(
"total pods available: %d, less than the min required: %d"
,
totalAvailable
,
minAvailable
)
return
false
,
fmt
.
Errorf
(
"total pods available: %d, less than the min required: %d"
,
totalAvailable
,
minAvailable
)
}
}
...
@@ -1949,9 +1951,11 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
...
@@ -1949,9 +1951,11 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
deployment
.
Status
.
UpdatedReplicas
==
desiredUpdatedReplicas
{
deployment
.
Status
.
UpdatedReplicas
==
desiredUpdatedReplicas
{
// Verify RCs.
// Verify RCs.
if
deploymentutil
.
GetReplicaCountForRCs
(
oldRCs
)
!=
0
{
if
deploymentutil
.
GetReplicaCountForRCs
(
oldRCs
)
!=
0
{
logRCsOfDeployment
(
deploymentName
,
oldRCs
,
newRC
)
return
false
,
fmt
.
Errorf
(
"old RCs are not fully scaled down"
)
return
false
,
fmt
.
Errorf
(
"old RCs are not fully scaled down"
)
}
}
if
deploymentutil
.
GetReplicaCountForRCs
([]
*
api
.
ReplicationController
{
newRC
})
!=
desiredUpdatedReplicas
{
if
deploymentutil
.
GetReplicaCountForRCs
([]
*
api
.
ReplicationController
{
newRC
})
!=
desiredUpdatedReplicas
{
logRCsOfDeployment
(
deploymentName
,
oldRCs
,
newRC
)
return
false
,
fmt
.
Errorf
(
"new RC is not fully scaled up"
)
return
false
,
fmt
.
Errorf
(
"new RC is not fully scaled up"
)
}
}
return
true
,
nil
return
true
,
nil
...
@@ -1960,6 +1964,13 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
...
@@ -1960,6 +1964,13 @@ func waitForDeploymentStatus(c *client.Client, ns, deploymentName string, desire
})
})
}
}
func
logRCsOfDeployment
(
deploymentName
string
,
oldRCs
[]
*
api
.
ReplicationController
,
newRC
*
api
.
ReplicationController
)
{
for
i
:=
range
oldRCs
{
Logf
(
"Old RCs (%d/%d) of deployment %s: %+v"
,
i
+
1
,
len
(
oldRCs
),
deploymentName
,
oldRCs
[
i
])
}
Logf
(
"New RC of deployment %s: %+v"
,
deploymentName
,
newRC
)
}
// Waits for the number of events on the given object to reach a desired count.
// Waits for the number of events on the given object to reach a desired count.
func
waitForEvents
(
c
*
client
.
Client
,
ns
string
,
objOrRef
runtime
.
Object
,
desiredEventsCount
int
)
error
{
func
waitForEvents
(
c
*
client
.
Client
,
ns
string
,
objOrRef
runtime
.
Object
,
desiredEventsCount
int
)
error
{
return
wait
.
Poll
(
poll
,
5
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
return
wait
.
Poll
(
poll
,
5
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
...
...
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