MCPcopy
hub / github.com/istio/istio / NewNonBlockingDiscoveryNamespacesFilter

Function NewNonBlockingDiscoveryNamespacesFilter

pkg/kube/namespace/filter.go:124–134  ·  view source on GitHub ↗

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{},
)

Source from the content-addressed store, hash-verified

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.
124func 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
136func (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.

Callers

nothing calls this directly

Calls 4

WaitForCacheSyncFunction · 0.92
selectorsChangedMethod · 0.80
MeshMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…