layer1: add default watcher config helper

This commit is contained in:
Naeel
2026-04-26 11:03:39 +03:00
parent d24605a8b8
commit 6e037a506d
6 changed files with 54 additions and 18 deletions
+9
View File
@@ -110,6 +110,15 @@ func NewWatcherNamespaceManager(ctx context.Context, namespaces []string, source
return manager, err
}
func NewDefaultManagedNamespaceWatcherConfig(component string, subscriber NamespaceSubscriber) ManagedNamespaceWatcherConfig {
return ManagedNamespaceWatcherConfig{
Component: component,
Namespaces: DefaultNSResolver().Snapshot(),
RemovalStrategy: NamespaceRemovalStrategyTrackOnly,
Subscriber: subscriber,
}
}
func PrepareManagedNamespaceWatcher(ctx context.Context, logger *zap.Logger, config ManagedNamespaceWatcherConfig) (NamespaceManager, k8sCache.ResourceEventHandlerFuncs, error) {
strategy := config.RemovalStrategy
if strategy == "" {