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
a9050679
Commit
a9050679
authored
Jan 20, 2016
by
Alex Mohr
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19520 from janetkuo/deployment-expectation-fix
Fix e2e flake: Fix incorrect expectation when deployment scaling down old rcs
parents
a5d2c1b0
d693ffaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+10
-7
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
a9050679
...
@@ -633,6 +633,7 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
...
@@ -633,6 +633,7 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
return
false
,
nil
return
false
,
nil
}
}
totalScaleDownCount
:=
readyPodCount
-
minAvailable
totalScaleDownCount
:=
readyPodCount
-
minAvailable
totalScaledDown
:=
0
for
_
,
targetRC
:=
range
oldRCs
{
for
_
,
targetRC
:=
range
oldRCs
{
if
totalScaleDownCount
==
0
{
if
totalScaleDownCount
==
0
{
// No further scaling required.
// No further scaling required.
...
@@ -649,14 +650,16 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
...
@@ -649,14 +650,16 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
totalScaledDown
+=
scaleDownCount
totalScaleDownCount
-=
scaleDownCount
totalScaleDownCount
-=
scaleDownCount
dKey
,
err
:=
controller
.
KeyFunc
(
&
deployment
)
}
if
err
!=
nil
{
// Expect to see old rcs scaled down by exactly totalScaledDownCount (sum of scaleDownCount) replicas.
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
dKey
,
err
=
controller
.
KeyFunc
(
&
deployment
)
}
if
err
!=
nil
{
if
expectationsCheck
{
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
dc
.
podExpectations
.
ExpectDeletions
(
dKey
,
scaleDownCount
)
}
}
if
expectationsCheck
{
dc
.
podExpectations
.
ExpectDeletions
(
dKey
,
totalScaledDown
)
}
}
return
true
,
err
return
true
,
err
}
}
...
...
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