Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for KnownOrCallback (0.19 sec)

  1. pkg/kube/kclient/crdwatcher_test.go

    	ctl := c.CrdWatcher()
    	// Created before informer runs
    	assert.Equal(t, ctl.KnownOrCallback(gvr.VirtualService, func(s <-chan struct{}) {
    		assert.Equal(t, s, stop)
    		vsCalls.Inc()
    	}), false)
    
    	c.RunAndWait(stop)
    	assert.EventuallyEqual(t, vsCalls.Load, 1)
    
    	// created once running
    	assert.Equal(t, ctl.KnownOrCallback(gvr.GatewayClass, func(s <-chan struct{}) {
    		t.Fatalf("callback should not be called")
    	}), true)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 25 14:44:17 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  2. pkg/kube/kclient/delayed.go

    	Resource schema.GroupVersionResource
    }
    
    func (d *delayedFilter) HasSynced() bool {
    	return d.Watcher.HasSynced()
    }
    
    func (d *delayedFilter) KnownOrCallback(f func(stop <-chan struct{})) bool {
    	return d.Watcher.KnownOrCallback(d.Resource, f)
    }
    
    func newDelayedFilter(resource schema.GroupVersionResource, watcher kubetypes.CrdWatcher) *delayedFilter {
    	return &delayedFilter{
    		Watcher:  watcher,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 31 02:32:59 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  3. pkg/kube/kubetypes/types.go

    type CrdWatcher interface {
    	// HasSynced returns true once all existing state has been synced.
    	HasSynced() bool
    	// KnownOrCallback returns `true` immediately if the resource is known.
    	// If it is not known, `false` is returned. If the resource is later added, the callback will be triggered.
    	KnownOrCallback(s schema.GroupVersionResource, f func(stop <-chan struct{})) bool
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 28 16:41:38 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  4. pkg/kube/kclient/crdwatcher.go

    	done := make(chan struct{})
    	if c.KnownOrCallback(s, func(stop <-chan struct{}) {
    		close(done)
    	}) {
    		// Already known
    		return true
    	}
    	select {
    	case <-stop:
    		return false
    	case <-done:
    		return true
    	}
    }
    
    // KnownOrCallback returns `true` immediately if the resource is known.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 25 14:44:17 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. pkg/kube/kclient/client.go

    	}
    
    	// If resource is not yet known, we will use the delayedClient.
    	// When the resource is later loaded, the callback will trigger and swap our dummy delayedClient
    	// with a full client
    	readyNow := delay.KnownOrCallback(func(stop <-chan struct{}) {
    		// The inf() call is responsible for starting the informer
    		inf := getInf()
    		fc := &informerClient[T]{
    			informer:      inf.Informer,
    			startInformer: inf.Start,
    		}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 17 07:14:28 UTC 2024
    - 13K bytes
    - Viewed (0)
Back to top