Skip to content

Commit

Permalink
don't queue namespaces for deletion if the namespace isn't deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed May 24, 2017
1 parent 6f7eac6 commit ba5a111
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/controller/namespace/namespace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ func (nm *NamespaceController) enqueueNamespace(obj interface{}) {
utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err))
return
}

namespace := obj.(*v1.Namespace)
// don't queue if we aren't deleted
if namespace.DeletionTimestamp == nil || namespace.DeletionTimestamp.IsZero() {
return
}

// delay processing namespace events to allow HA api servers to observe namespace deletion,
// and HA etcd servers to observe last minute object creations inside the namespace
nm.queue.AddAfter(key, namespaceDeletionGracePeriod)
Expand Down

0 comments on commit ba5a111

Please sign in to comment.