NewNonBlockingDiscoveryNamespacesFilter creates the filter without blocking to wait on the initial sync. Use the returned ManualSyncWaiter to wait for the initial sync when desired.
(
namespaces kclient.Client[*corev1.Namespace],
mesh mesh.Watcher,
stop <-chan struct{},
)
| 122 | // NewNonBlockingDiscoveryNamespacesFilter creates the filter without blocking to wait on the initial sync. |
| 123 | // Use the returned ManualSyncWaiter to wait for the initial sync when desired. |
| 124 | func NewNonBlockingDiscoveryNamespacesFilter( |
| 125 | namespaces kclient.Client[*corev1.Namespace], |
| 126 | mesh mesh.Watcher, |
| 127 | stop <-chan struct{}, |
| 128 | ) (kubetypes.DynamicObjectFilter, ManualSyncWaiter) { |
| 129 | f := newDiscoveryNamespacesFilter(namespaces, mesh, stop, false) |
| 130 | return f, func(stop <-chan struct{}) { |
| 131 | kube.WaitForCacheSync("discovery filter", stop, namespaces.HasSynced) |
| 132 | f.selectorsChanged(mesh.Mesh().GetDiscoverySelectors(), false) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func (d *discoveryNamespacesFilter) notifyHandlers(added sets.Set[string], removed sets.String) { |
| 137 | // Clone handlers; we handle dynamic handlers so they can change after the filter has started. |
nothing calls this directly
no test coverage detected
searching dependent graphs…