mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Merge pull request #46373 from deads2k/controller-06-queue
Automatic merge from submit-queue (batch tested with PRs 45913, 46065, 46352, 46363, 46373) don't queue namespaces for deletion if the namespace isn't deleted Most namespaces aren't deleted most of the time. No need to queue them for cleanup if they aren't deleted.
This commit is contained in:
commit
4def5add11
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user