layer1: prepare managed namespace watchers
This commit is contained in:
@@ -109,6 +109,12 @@ func NewWatcherNamespaceManager(ctx context.Context, namespaces []string, source
|
||||
return manager, err
|
||||
}
|
||||
|
||||
func PrepareManagedNamespaceWatcher(ctx context.Context, logger *zap.Logger, component string, namespaces []string, removalStrategy NamespaceRemovalStrategy, subscriber NamespaceSubscriber) (NamespaceManager, k8sCache.ResourceEventHandlerFuncs, error) {
|
||||
manager, err := NewWatcherNamespaceManager(ctx, namespaces, NamespaceSourceEnv, time.Now().UTC(), subscriber)
|
||||
handlers := NewNamespaceWatcherEventHandlers(ctx, logger, component, manager, removalStrategy)
|
||||
return manager, handlers, err
|
||||
}
|
||||
|
||||
func NamespaceBecameUnmanaged(oldNamespace *corev1.Namespace, newNamespace *corev1.Namespace) bool {
|
||||
if oldNamespace == nil || newNamespace == nil {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user