deployment: Ignore namespace termination errors when creating replicasets

Instead of reporting an event or displaying an error, simply exit
when the namespace is being terminated. This reduces the amount of
controller churn on namespace shutdown. Unlike other controllers, we
drop the replica set create error very late (in the queue handleErr)
in order to avoid changing the structure of the controller
substantially.
This commit is contained in:
Clayton Coleman
2019-10-20 16:26:18 -04:00
parent c6e34e58c5
commit bd9260711f
2 changed files with 4 additions and 1 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
}