Merge pull request #84123 from smarterclayton/terminating_cause

Handle namespace deletion more gracefully in built-in controllers
This commit is contained in:
Kubernetes Prow Robot
2019-11-04 07:55:41 -08:00
committed by GitHub
17 changed files with 131 additions and 33 deletions

View File

@@ -475,7 +475,7 @@ func (dc *DeploymentController) processNextWorkItem() bool {
}
func (dc *DeploymentController) handleErr(err error, key interface{}) {
if err == nil {
if err == nil || errors.HasStatusCause(err, v1.NamespaceTerminatingCause) {
dc.queue.Forget(key)
return
}

View File

@@ -256,6 +256,9 @@ func (dc *DeploymentController) getNewReplicaSet(d *apps.Deployment, rsList, old
klog.V(2).Infof("Found a hash collision for deployment %q - bumping collisionCount (%d->%d) to resolve it", d.Name, preCollisionCount, *d.Status.CollisionCount)
}
return nil, err
case errors.HasStatusCause(err, v1.NamespaceTerminatingCause):
// if the namespace is terminating, all subsequent creates will fail and we can safely do nothing
return nil, err
case err != nil:
msg := fmt.Sprintf("Failed to create new replica set %q: %v", newRS.Name, err)
if deploymentutil.HasProgressDeadline(d) {