- DefaultNSResolver.RemoveNamespace(): removes NS from global map on label removal
so Snapshot() and idleObjectReaper stop iterating deleted namespaces.
Fixes class of dirty-state bugs when NS name is reused by new tenant.
- HandleWatcherNamespaceRemoval: call RemoveNamespace on both TrackOnly and
DispatchRemove strategies — global resolver cleanup is always required.
- dispatch(): parallel subscriber execution via goroutine per subscriber +
sync.WaitGroup. Reduces onboarding latency from O(N_subscribers × API_latency)
to O(max(API_latency)). Safe: MarkPart* are internally mutex-protected.
- inMemoryNamespaceManager.RunReconciler(): 30s ticker scans for
NamespacePhaseFailed records and retries via DispatchResync. Started
automatically by RunManagedNamespaceWatcher. Fixes permanent stuck-failed
state caused by transient k8s API errors.
Analysis source: FORENSIC_ARCHITECTURE_AUDIT.md §Deep Risk Analysis
TestStartManagedNamespaceWatcherIntegration проверяет полный маршрут
горячей регистрации namespace без real cluster:
1. RunManagedNamespaceWatcher запускается с k8sfake.NewSimpleClientset()
2. В fake client создаётся Namespace с label fission.io/managed=true
3. Kubernetes informer детектирует событие (без polling, через Watch)
4. SubscriberFuncs.OnNamespaceAdd вызывается
5. NamespaceManager содержит запись со статусом Active
Тест доказывает, что вся цепочка
fake k8s event → informer → AddFunc → subscriber → manager
работает корректно без rolling restart процесса.
Также добавлен import metav1 в test file (требовался для CreateOptions).