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
1acfb151
Commit
1acfb151
authored
Jan 14, 2016
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19433 from janetkuo/deployment-e2e-flake-fix
Fix flaky e2e: Use expectation model for deployment's new rc creation
parents
74223880
c2463a5a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
40 deletions
+69
-40
controller_utils.go
pkg/controller/controller_utils.go
+32
-32
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+37
-8
No files found.
pkg/controller/controller_utils.go
View file @
1acfb151
...
@@ -76,16 +76,16 @@ func StaticResyncPeriodFunc(resyncPeriod time.Duration) ResyncPeriodFunc {
...
@@ -76,16 +76,16 @@ func StaticResyncPeriodFunc(resyncPeriod time.Duration) ResyncPeriodFunc {
// }
// }
//
//
// Implementation:
// Implementation:
//
PodExpectation = pair of atomic counters to track pod
creation/deletion
//
ControlleeExpectation = pair of atomic counters to track controllee's
creation/deletion
// ControllerExpectationsStore = TTLStore + a
Pod
Expectation per controller
// ControllerExpectationsStore = TTLStore + a
Controllee
Expectation per controller
//
//
// * Once set expectations can only be lowered
// * Once set expectations can only be lowered
// * A controller isn't synced till its expectations are either fulfilled, or expire
// * A controller isn't synced till its expectations are either fulfilled, or expire
// * Controllers that don't set expectations will get woken up for every matching
pod
// * Controllers that don't set expectations will get woken up for every matching
controllee
// ExpKeyFunc to parse out the key from a
Pod
Expectation
// ExpKeyFunc to parse out the key from a
Controllee
Expectation
var
ExpKeyFunc
=
func
(
obj
interface
{})
(
string
,
error
)
{
var
ExpKeyFunc
=
func
(
obj
interface
{})
(
string
,
error
)
{
if
e
,
ok
:=
obj
.
(
*
Pod
Expectations
);
ok
{
if
e
,
ok
:=
obj
.
(
*
Controllee
Expectations
);
ok
{
return
e
.
key
,
nil
return
e
.
key
,
nil
}
}
return
""
,
fmt
.
Errorf
(
"Could not find key for obj %#v"
,
obj
)
return
""
,
fmt
.
Errorf
(
"Could not find key for obj %#v"
,
obj
)
...
@@ -96,7 +96,7 @@ var ExpKeyFunc = func(obj interface{}) (string, error) {
...
@@ -96,7 +96,7 @@ var ExpKeyFunc = func(obj interface{}) (string, error) {
// Warning: if using KeyFunc it is not safe to use a single ControllerExpectationsInterface with different
// Warning: if using KeyFunc it is not safe to use a single ControllerExpectationsInterface with different
// types of controllers, because the keys might conflict across types.
// types of controllers, because the keys might conflict across types.
type
ControllerExpectationsInterface
interface
{
type
ControllerExpectationsInterface
interface
{
GetExpectations
(
controllerKey
string
)
(
*
Pod
Expectations
,
bool
,
error
)
GetExpectations
(
controllerKey
string
)
(
*
Controllee
Expectations
,
bool
,
error
)
SatisfiedExpectations
(
controllerKey
string
)
bool
SatisfiedExpectations
(
controllerKey
string
)
bool
DeleteExpectations
(
controllerKey
string
)
DeleteExpectations
(
controllerKey
string
)
SetExpectations
(
controllerKey
string
,
add
,
del
int
)
error
SetExpectations
(
controllerKey
string
,
add
,
del
int
)
error
...
@@ -111,10 +111,10 @@ type ControllerExpectations struct {
...
@@ -111,10 +111,10 @@ type ControllerExpectations struct {
cache
.
Store
cache
.
Store
}
}
// GetExpectations returns the
Pod
Expectations of the given controller.
// GetExpectations returns the
Controllee
Expectations of the given controller.
func
(
r
*
ControllerExpectations
)
GetExpectations
(
controllerKey
string
)
(
*
Pod
Expectations
,
bool
,
error
)
{
func
(
r
*
ControllerExpectations
)
GetExpectations
(
controllerKey
string
)
(
*
Controllee
Expectations
,
bool
,
error
)
{
if
podE
xp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
);
err
==
nil
&&
exists
{
if
e
xp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
);
err
==
nil
&&
exists
{
return
podExp
.
(
*
Pod
Expectations
),
true
,
nil
return
exp
.
(
*
Controllee
Expectations
),
true
,
nil
}
else
{
}
else
{
return
nil
,
false
,
err
return
nil
,
false
,
err
}
}
...
@@ -122,22 +122,22 @@ func (r *ControllerExpectations) GetExpectations(controllerKey string) (*PodExpe
...
@@ -122,22 +122,22 @@ func (r *ControllerExpectations) GetExpectations(controllerKey string) (*PodExpe
// DeleteExpectations deletes the expectations of the given controller from the TTLStore.
// DeleteExpectations deletes the expectations of the given controller from the TTLStore.
func
(
r
*
ControllerExpectations
)
DeleteExpectations
(
controllerKey
string
)
{
func
(
r
*
ControllerExpectations
)
DeleteExpectations
(
controllerKey
string
)
{
if
podE
xp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
);
err
==
nil
&&
exists
{
if
e
xp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
);
err
==
nil
&&
exists
{
if
err
:=
r
.
Delete
(
podE
xp
);
err
!=
nil
{
if
err
:=
r
.
Delete
(
e
xp
);
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"Error deleting expectations for controller %v: %v"
,
controllerKey
,
err
)
glog
.
V
(
2
)
.
Infof
(
"Error deleting expectations for controller %v: %v"
,
controllerKey
,
err
)
}
}
}
}
}
}
// SatisfiedExpectations returns true if the required adds/dels for the given controller have been observed.
// SatisfiedExpectations returns true if the required adds/dels for the given controller have been observed.
// Add/del counts are established by the controller at sync time, and updated as
pod
s are observed by the controller
// Add/del counts are established by the controller at sync time, and updated as
controllee
s are observed by the controller
// manager.
// manager.
func
(
r
*
ControllerExpectations
)
SatisfiedExpectations
(
controllerKey
string
)
bool
{
func
(
r
*
ControllerExpectations
)
SatisfiedExpectations
(
controllerKey
string
)
bool
{
if
podE
xp
,
exists
,
err
:=
r
.
GetExpectations
(
controllerKey
);
exists
{
if
e
xp
,
exists
,
err
:=
r
.
GetExpectations
(
controllerKey
);
exists
{
if
podE
xp
.
Fulfilled
()
{
if
e
xp
.
Fulfilled
()
{
return
true
return
true
}
else
{
}
else
{
glog
.
V
(
4
)
.
Infof
(
"Controller still waiting on expectations %#v"
,
podE
xp
)
glog
.
V
(
4
)
.
Infof
(
"Controller still waiting on expectations %#v"
,
e
xp
)
return
false
return
false
}
}
}
else
if
err
!=
nil
{
}
else
if
err
!=
nil
{
...
@@ -145,9 +145,9 @@ func (r *ControllerExpectations) SatisfiedExpectations(controllerKey string) boo
...
@@ -145,9 +145,9 @@ func (r *ControllerExpectations) SatisfiedExpectations(controllerKey string) boo
}
else
{
}
else
{
// When a new controller is created, it doesn't have expectations.
// When a new controller is created, it doesn't have expectations.
// When it doesn't see expected watch events for > TTL, the expectations expire.
// When it doesn't see expected watch events for > TTL, the expectations expire.
// - In this case it wakes up, creates/deletes
pod
s, and sets expectations again.
// - In this case it wakes up, creates/deletes
controllee
s, and sets expectations again.
// When it has satisfied expectations and no
pod
s need to be created/destroyed > TTL, the expectations expire.
// When it has satisfied expectations and no
controllee
s need to be created/destroyed > TTL, the expectations expire.
// - In this case it continues without setting expectations till it needs to create/delete
pod
s.
// - In this case it continues without setting expectations till it needs to create/delete
controllee
s.
glog
.
V
(
4
)
.
Infof
(
"Controller %v either never recorded expectations, or the ttl expired."
,
controllerKey
)
glog
.
V
(
4
)
.
Infof
(
"Controller %v either never recorded expectations, or the ttl expired."
,
controllerKey
)
}
}
// Trigger a sync if we either encountered and error (which shouldn't happen since we're
// Trigger a sync if we either encountered and error (which shouldn't happen since we're
...
@@ -157,9 +157,9 @@ func (r *ControllerExpectations) SatisfiedExpectations(controllerKey string) boo
...
@@ -157,9 +157,9 @@ func (r *ControllerExpectations) SatisfiedExpectations(controllerKey string) boo
// SetExpectations registers new expectations for the given controller. Forgets existing expectations.
// SetExpectations registers new expectations for the given controller. Forgets existing expectations.
func
(
r
*
ControllerExpectations
)
SetExpectations
(
controllerKey
string
,
add
,
del
int
)
error
{
func
(
r
*
ControllerExpectations
)
SetExpectations
(
controllerKey
string
,
add
,
del
int
)
error
{
podExp
:=
&
Pod
Expectations
{
add
:
int64
(
add
),
del
:
int64
(
del
),
key
:
controllerKey
}
exp
:=
&
Controllee
Expectations
{
add
:
int64
(
add
),
del
:
int64
(
del
),
key
:
controllerKey
}
glog
.
V
(
4
)
.
Infof
(
"Setting expectations %+v"
,
podE
xp
)
glog
.
V
(
4
)
.
Infof
(
"Setting expectations %+v"
,
e
xp
)
return
r
.
Add
(
podE
xp
)
return
r
.
Add
(
e
xp
)
}
}
func
(
r
*
ControllerExpectations
)
ExpectCreations
(
controllerKey
string
,
adds
int
)
error
{
func
(
r
*
ControllerExpectations
)
ExpectCreations
(
controllerKey
string
,
adds
int
)
error
{
...
@@ -172,10 +172,10 @@ func (r *ControllerExpectations) ExpectDeletions(controllerKey string, dels int)
...
@@ -172,10 +172,10 @@ func (r *ControllerExpectations) ExpectDeletions(controllerKey string, dels int)
// Decrements the expectation counts of the given controller.
// Decrements the expectation counts of the given controller.
func
(
r
*
ControllerExpectations
)
lowerExpectations
(
controllerKey
string
,
add
,
del
int
)
{
func
(
r
*
ControllerExpectations
)
lowerExpectations
(
controllerKey
string
,
add
,
del
int
)
{
if
podE
xp
,
exists
,
err
:=
r
.
GetExpectations
(
controllerKey
);
err
==
nil
&&
exists
{
if
e
xp
,
exists
,
err
:=
r
.
GetExpectations
(
controllerKey
);
err
==
nil
&&
exists
{
podE
xp
.
Seen
(
int64
(
add
),
int64
(
del
))
e
xp
.
Seen
(
int64
(
add
),
int64
(
del
))
// The expectations might've been modified since the update on the previous line.
// The expectations might've been modified since the update on the previous line.
glog
.
V
(
4
)
.
Infof
(
"Lowering expectations %+v"
,
podE
xp
)
glog
.
V
(
4
)
.
Infof
(
"Lowering expectations %+v"
,
e
xp
)
}
}
}
}
...
@@ -194,31 +194,31 @@ type Expectations interface {
...
@@ -194,31 +194,31 @@ type Expectations interface {
Fulfilled
()
bool
Fulfilled
()
bool
}
}
//
PodExpectations track pod
creates/deletes.
//
ControlleeExpectations track controllee
creates/deletes.
type
Pod
Expectations
struct
{
type
Controllee
Expectations
struct
{
add
int64
add
int64
del
int64
del
int64
key
string
key
string
}
}
// Seen decrements the add and del counters.
// Seen decrements the add and del counters.
func
(
e
*
Pod
Expectations
)
Seen
(
add
,
del
int64
)
{
func
(
e
*
Controllee
Expectations
)
Seen
(
add
,
del
int64
)
{
atomic
.
AddInt64
(
&
e
.
add
,
-
add
)
atomic
.
AddInt64
(
&
e
.
add
,
-
add
)
atomic
.
AddInt64
(
&
e
.
del
,
-
del
)
atomic
.
AddInt64
(
&
e
.
del
,
-
del
)
}
}
// Fulfilled returns true if this expectation has been fulfilled.
// Fulfilled returns true if this expectation has been fulfilled.
func
(
e
*
Pod
Expectations
)
Fulfilled
()
bool
{
func
(
e
*
Controllee
Expectations
)
Fulfilled
()
bool
{
// TODO: think about why this line being atomic doesn't matter
// TODO: think about why this line being atomic doesn't matter
return
atomic
.
LoadInt64
(
&
e
.
add
)
<=
0
&&
atomic
.
LoadInt64
(
&
e
.
del
)
<=
0
return
atomic
.
LoadInt64
(
&
e
.
add
)
<=
0
&&
atomic
.
LoadInt64
(
&
e
.
del
)
<=
0
}
}
// GetExpectations returns the add and del expectations of the
pod
.
// GetExpectations returns the add and del expectations of the
controllee
.
func
(
e
*
Pod
Expectations
)
GetExpectations
()
(
int64
,
int64
)
{
func
(
e
*
Controllee
Expectations
)
GetExpectations
()
(
int64
,
int64
)
{
return
atomic
.
LoadInt64
(
&
e
.
add
),
atomic
.
LoadInt64
(
&
e
.
del
)
return
atomic
.
LoadInt64
(
&
e
.
add
),
atomic
.
LoadInt64
(
&
e
.
del
)
}
}
// NewControllerExpectations returns a store for
Pod
Expectations.
// NewControllerExpectations returns a store for
Controllee
Expectations.
func
NewControllerExpectations
()
*
ControllerExpectations
{
func
NewControllerExpectations
()
*
ControllerExpectations
{
return
&
ControllerExpectations
{
cache
.
NewTTLStore
(
ExpKeyFunc
,
ExpectationsTimeout
)}
return
&
ControllerExpectations
{
cache
.
NewTTLStore
(
ExpKeyFunc
,
ExpectationsTimeout
)}
}
}
...
...
pkg/controller/deployment/deployment_controller.go
View file @
1acfb151
...
@@ -78,7 +78,11 @@ type DeploymentController struct {
...
@@ -78,7 +78,11 @@ type DeploymentController struct {
podStoreSynced
func
()
bool
podStoreSynced
func
()
bool
// A TTLCache of pod creates/deletes each deployment expects to see
// A TTLCache of pod creates/deletes each deployment expects to see
expectations
controller
.
ControllerExpectationsInterface
podExpectations
controller
.
ControllerExpectationsInterface
// A TTLCache of rc creates/deletes each deployment expects to see
// TODO: make expectation model understand (rc) updates (besides adds and deletes)
rcExpectations
controller
.
ControllerExpectationsInterface
// Deployments that need to be synced
// Deployments that need to be synced
queue
*
workqueue
.
Type
queue
*
workqueue
.
Type
...
@@ -95,7 +99,8 @@ func NewDeploymentController(client client.Interface, resyncPeriod controller.Re
...
@@ -95,7 +99,8 @@ func NewDeploymentController(client client.Interface, resyncPeriod controller.Re
expClient
:
client
.
Extensions
(),
expClient
:
client
.
Extensions
(),
eventRecorder
:
eventBroadcaster
.
NewRecorder
(
api
.
EventSource
{
Component
:
"deployment-controller"
}),
eventRecorder
:
eventBroadcaster
.
NewRecorder
(
api
.
EventSource
{
Component
:
"deployment-controller"
}),
queue
:
workqueue
.
New
(),
queue
:
workqueue
.
New
(),
expectations
:
controller
.
NewControllerExpectations
(),
podExpectations
:
controller
.
NewControllerExpectations
(),
rcExpectations
:
controller
.
NewControllerExpectations
(),
}
}
dc
.
dStore
.
Store
,
dc
.
dController
=
framework
.
NewInformer
(
dc
.
dStore
.
Store
,
dc
.
dController
=
framework
.
NewInformer
(
...
@@ -192,6 +197,12 @@ func (dc *DeploymentController) addRC(obj interface{}) {
...
@@ -192,6 +197,12 @@ func (dc *DeploymentController) addRC(obj interface{}) {
rc
:=
obj
.
(
*
api
.
ReplicationController
)
rc
:=
obj
.
(
*
api
.
ReplicationController
)
glog
.
V
(
4
)
.
Infof
(
"Replication controller %s added."
,
rc
.
Name
)
glog
.
V
(
4
)
.
Infof
(
"Replication controller %s added."
,
rc
.
Name
)
if
d
:=
dc
.
getDeploymentForRC
(
rc
);
rc
!=
nil
{
if
d
:=
dc
.
getDeploymentForRC
(
rc
);
rc
!=
nil
{
dKey
,
err
:=
controller
.
KeyFunc
(
d
)
if
err
!=
nil
{
glog
.
Errorf
(
"Couldn't get key for deployment controller %#v: %v"
,
d
,
err
)
return
}
dc
.
rcExpectations
.
CreationObserved
(
dKey
)
dc
.
enqueueDeployment
(
d
)
dc
.
enqueueDeployment
(
d
)
}
}
}
}
...
@@ -329,7 +340,7 @@ func (dc *DeploymentController) deletePod(obj interface{}) {
...
@@ -329,7 +340,7 @@ func (dc *DeploymentController) deletePod(obj interface{}) {
glog
.
Errorf
(
"Couldn't get key for deployment controller %#v: %v"
,
d
,
err
)
glog
.
Errorf
(
"Couldn't get key for deployment controller %#v: %v"
,
d
,
err
)
return
return
}
}
dc
.
e
xpectations
.
DeletionObserved
(
dKey
)
dc
.
podE
xpectations
.
DeletionObserved
(
dKey
)
}
}
}
}
...
@@ -384,7 +395,8 @@ func (dc *DeploymentController) syncDeployment(key string) error {
...
@@ -384,7 +395,8 @@ func (dc *DeploymentController) syncDeployment(key string) error {
}
}
if
!
exists
{
if
!
exists
{
glog
.
Infof
(
"Deployment has been deleted %v"
,
key
)
glog
.
Infof
(
"Deployment has been deleted %v"
,
key
)
dc
.
expectations
.
DeleteExpectations
(
key
)
dc
.
podExpectations
.
DeleteExpectations
(
key
)
dc
.
rcExpectations
.
DeleteExpectations
(
key
)
return
nil
return
nil
}
}
d
:=
*
obj
.
(
*
extensions
.
Deployment
)
d
:=
*
obj
.
(
*
extensions
.
Deployment
)
...
@@ -392,7 +404,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
...
@@ -392,7 +404,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
// Sleep so we give the rc reflector goroutine a chance to run.
// Sleep so we give the rc reflector goroutine a chance to run.
time
.
Sleep
(
RcStoreSyncedPollPeriod
)
time
.
Sleep
(
RcStoreSyncedPollPeriod
)
glog
.
Infof
(
"Waiting for rc controller to sync, requeuing deployment %s"
,
d
.
Name
)
glog
.
Infof
(
"Waiting for rc controller to sync, requeuing deployment %s"
,
d
.
Name
)
dc
.
enqueueDeployment
(
d
)
dc
.
enqueueDeployment
(
&
d
)
return
nil
return
nil
}
}
...
@@ -506,6 +518,15 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
...
@@ -506,6 +518,15 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
if
err
!=
nil
||
existingNewRC
!=
nil
{
if
err
!=
nil
||
existingNewRC
!=
nil
{
return
existingNewRC
,
err
return
existingNewRC
,
err
}
}
// Check the rc expectations of deployment before creating a new rc
dKey
,
err
:=
controller
.
KeyFunc
(
&
deployment
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
}
if
!
dc
.
rcExpectations
.
SatisfiedExpectations
(
dKey
)
{
dc
.
enqueueDeployment
(
&
deployment
)
return
nil
,
fmt
.
Errorf
(
"RC expectations not met yet before getting new RC
\n
"
)
}
// new RC does not exist, create one.
// new RC does not exist, create one.
namespace
:=
deployment
.
ObjectMeta
.
Namespace
namespace
:=
deployment
.
ObjectMeta
.
Namespace
podTemplateSpecHash
:=
deploymentutil
.
GetPodTemplateSpecHash
(
deployment
.
Spec
.
Template
)
podTemplateSpecHash
:=
deploymentutil
.
GetPodTemplateSpecHash
(
deployment
.
Spec
.
Template
)
...
@@ -513,6 +534,13 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
...
@@ -513,6 +534,13 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
// Add podTemplateHash label to selector.
// Add podTemplateHash label to selector.
newRCSelector
:=
deploymentutil
.
CloneAndAddLabel
(
deployment
.
Spec
.
Selector
,
deployment
.
Spec
.
UniqueLabelKey
,
podTemplateSpecHash
)
newRCSelector
:=
deploymentutil
.
CloneAndAddLabel
(
deployment
.
Spec
.
Selector
,
deployment
.
Spec
.
UniqueLabelKey
,
podTemplateSpecHash
)
// Set RC expectations (1 rc should be created)
dKey
,
err
=
controller
.
KeyFunc
(
&
deployment
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"couldn't get key for deployment controller %#v: %v"
,
deployment
,
err
)
}
dc
.
rcExpectations
.
ExpectCreations
(
dKey
,
1
)
// Create new RC
newRC
:=
api
.
ReplicationController
{
newRC
:=
api
.
ReplicationController
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
GenerateName
:
deployment
.
Name
+
"-"
,
GenerateName
:
deployment
.
Name
+
"-"
,
...
@@ -526,6 +554,7 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
...
@@ -526,6 +554,7 @@ func (dc *DeploymentController) getNewRC(deployment extensions.Deployment) (*api
}
}
createdRC
,
err
:=
dc
.
client
.
ReplicationControllers
(
namespace
)
.
Create
(
&
newRC
)
createdRC
,
err
:=
dc
.
client
.
ReplicationControllers
(
namespace
)
.
Create
(
&
newRC
)
if
err
!=
nil
{
if
err
!=
nil
{
dc
.
rcExpectations
.
DeleteExpectations
(
dKey
)
return
nil
,
fmt
.
Errorf
(
"error creating replication controller: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error creating replication controller: %v"
,
err
)
}
}
return
createdRC
,
nil
return
createdRC
,
nil
...
@@ -587,8 +616,8 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
...
@@ -587,8 +616,8 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
}
}
if
expectationsCheck
&&
!
dc
.
e
xpectations
.
SatisfiedExpectations
(
dKey
)
{
if
expectationsCheck
&&
!
dc
.
podE
xpectations
.
SatisfiedExpectations
(
dKey
)
{
fmt
.
Printf
(
"E
xpectations not met yet before reconciling old RCs
\n
"
)
glog
.
V
(
4
)
.
Infof
(
"Pod e
xpectations not met yet before reconciling old RCs
\n
"
)
return
false
,
nil
return
false
,
nil
}
}
// Find the number of ready pods.
// Find the number of ready pods.
...
@@ -624,7 +653,7 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
...
@@ -624,7 +653,7 @@ func (dc *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControl
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
return
false
,
fmt
.
Errorf
(
"Couldn't get key for deployment %#v: %v"
,
deployment
,
err
)
}
}
if
expectationsCheck
{
if
expectationsCheck
{
dc
.
e
xpectations
.
ExpectDeletions
(
dKey
,
scaleDownCount
)
dc
.
podE
xpectations
.
ExpectDeletions
(
dKey
,
scaleDownCount
)
}
}
}
}
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