controller: ensure deployment rollback is re-entrant
Make rollbacks re-entrant in the Deployment controller, otherwise fast enqueues of a Deployment may end up in undesired behavior - redundant rollbacks.
This commit is contained in:
@@ -570,11 +570,11 @@ func (dc *DeploymentController) syncDeployment(key string) error {
|
||||
return dc.sync(d)
|
||||
}
|
||||
|
||||
// rollback is not re-entrant in case the underlying replica sets are updated with a new
|
||||
// revision so we should ensure that we won't proceed to update replica sets until we
|
||||
// make sure that the deployment has cleaned up its rollback spec in subsequent enqueues.
|
||||
if d.Spec.RollbackTo != nil {
|
||||
revision := d.Spec.RollbackTo.Revision
|
||||
if d, err = dc.rollback(d, &revision); err != nil {
|
||||
return err
|
||||
}
|
||||
return dc.rollback(d)
|
||||
}
|
||||
|
||||
scalingEvent, err := dc.isScalingEvent(d)
|
||||
|
Reference in New Issue
Block a user