Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for AddMeshHandler (0.24 sec)

  1. pkg/config/mesh/watcher.go

    type Holder interface {
    	Mesh() *meshconfig.MeshConfig
    }
    
    // Watcher is a Holder whose mesh config can be updated asynchronously.
    type Watcher interface {
    	Holder
    
    	// AddMeshHandler registers a callback handler for changes to the mesh config.
    	AddMeshHandler(h func()) *WatcherHandlerRegistration
    
    	// DeleteMeshHandler unregisters a callback handler when remote cluster is removed.
    	DeleteMeshHandler(registration *WatcherHandlerRegistration)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Dec 20 18:33:38 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  2. pkg/config/mesh/watcher_test_utils.go

    func NewTestWatcher(meshConfig *meshconfig.MeshConfig) *TestWatcher {
    	w := &TestWatcher{
    		internalWatcher: internalWatcher{},
    	}
    	w.internalWatcher.MeshConfig.Store(meshConfig)
    	w.doneCh = make(chan struct{}, 1)
    	w.AddMeshHandler(func() {
    		w.doneCh <- struct{}{}
    	})
    	return w
    }
    
    // blocks until watcher handlers trigger
    func (t *TestWatcher) Update(meshConfig *meshconfig.MeshConfig, timeout time.Duration) error {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Nov 03 00:26:45 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  3. pkg/config/mesh/watcher_test.go

    	m := mesh.DefaultMeshConfig()
    	writeMessage(t, path, m)
    
    	w := newWatcher(t, path, multi)
    	assert.Equal(t, w.Mesh(), m)
    
    	doneCh := make(chan struct{}, 1)
    
    	var newM *meshconfig.MeshConfig
    	w.AddMeshHandler(func() {
    		newM = w.Mesh()
    		close(doneCh)
    	})
    
    	// Change the file to trigger the update.
    	m.IngressClass = "foo"
    	writeMessage(t, path, m)
    
    	select {
    	case <-doneCh:
    		assert.Equal(t, newM, m)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 3K bytes
    - Viewed (0)
  4. pilot/pkg/model/cluster_local.go

    func NewClusterLocalProvider(e *Environment) ClusterLocalProvider {
    	c := &clusterLocalProvider{}
    
    	// Register a handler to update the environment when the mesh config is updated.
    	e.AddMeshHandler(func() {
    		c.onMeshUpdated(e)
    	})
    
    	// Update the cluster-local hosts now.
    	c.onMeshUpdated(e)
    	return c
    }
    
    var _ ClusterLocalProvider = &clusterLocalProvider{}
    
    type clusterLocalProvider struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 20 12:54:10 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  5. pilot/pkg/config/kube/ingress/status.go

    			// Ingress selector matches this pod, enqueue everything
    			c.enqueueAll()
    		}
    	}))
    	// Mesh may have changed ingress fields, enqueue everything
    	c.meshConfig.AddMeshHandler(c.enqueueAll)
    	return c
    }
    
    // runningAddresses returns a list of IP addresses and/or FQDN in the namespace
    // where the ingress controller is currently running
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 28 16:41:38 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  6. pkg/kube/namespace/filter.go

    ) kubetypes.DynamicObjectFilter {
    	// convert LabelSelectors to Selectors
    	f := &discoveryNamespacesFilter{
    		namespaces:          namespaces,
    		discoveryNamespaces: sets.New[string](),
    	}
    	mesh.AddMeshHandler(func() {
    		f.selectorsChanged(mesh.Mesh().GetDiscoverySelectors(), true)
    	})
    
    	namespaces.AddEventHandler(controllers.EventHandler[*corev1.Namespace]{
    		AddFunc: func(ns *corev1.Namespace) {
    			f.lock.Lock()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 10 17:12:52 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  7. pkg/config/mesh/kubemesh/watcher_test.go

    	stop := test.NewStop(t)
    	w := NewConfigMapWatcher(client, namespace, name, key, false, stop)
    	client.RunAndWait(stop)
    
    	var mu sync.Mutex
    	newM := mesh.DefaultMeshConfig()
    	w.AddMeshHandler(func() {
    		mu.Lock()
    		defer mu.Unlock()
    		newM = w.Mesh()
    	})
    
    	steps := []struct {
    		added   *v1.ConfigMap
    		updated *v1.ConfigMap
    		deleted *v1.ConfigMap
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 7.7K bytes
    - Viewed (0)
  8. pilot/pkg/bootstrap/certcontroller.go

    	}
    	caBundle, err = s.RA.GetRootCertFromMeshConfig(signerName)
    	if err != nil {
    		return err
    	}
    
    	// MeshConfig:Add callback for mesh config update
    	s.environment.AddMeshHandler(func() {
    		newCaBundle, _ := s.RA.GetRootCertFromMeshConfig(signerName)
    		if newCaBundle != nil && !bytes.Equal(newCaBundle, s.istiodCertBundleWatcher.GetKeyCertBundle().CABundle) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 17:48:28 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  9. pilot/pkg/model/context.go

    		return "", "", fmt.Errorf("invalid Istiod Port: %s, %s, %v", port, proxyConfig.DiscoveryAddress, err)
    	}
    	return host.Name(hostname), port, nil
    }
    
    func (e *Environment) AddMeshHandler(h func()) {
    	if e != nil && e.Watcher != nil {
    		e.Watcher.AddMeshHandler(h)
    	}
    }
    
    func (e *Environment) AddNetworksHandler(h func()) {
    	if e != nil && e.NetworksWatcher != nil {
    		e.NetworksWatcher.AddNetworksHandler(h)
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 03 08:29:05 UTC 2024
    - 33.6K bytes
    - Viewed (0)
  10. pilot/pkg/bootstrap/server.go

    func (s *Server) initMeshHandlers(changeHandler func(_ *meshconfig.MeshConfig)) {
    	log.Info("initializing mesh handlers")
    	// When the mesh config or networks change, do a full push.
    	s.environment.AddMeshHandler(func() {
    		changeHandler(s.environment.Mesh())
    		s.XDSServer.ConfigUpdate(&model.PushRequest{
    			Full:   true,
    			Reason: model.NewReasonStats(model.GlobalUpdate),
    		})
    	})
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 17:48:28 UTC 2024
    - 46.3K bytes
    - Viewed (0)
Back to top