Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ReadCurrentPodSnapshot (0.25 sec)

  1. cni/pkg/nodeagent/pod_cache.go

    	"istio.io/istio/pkg/maps"
    	"istio.io/istio/pkg/zdsapi"
    )
    
    var ErrPodNotFound = errors.New("netns not provided, but is needed as pod is not in cache")
    
    type PodNetnsCache interface {
    	ReadCurrentPodSnapshot() map[string]WorkloadInfo
    }
    
    // Hold a cache of node local pods with their netns
    // if we don't know the netns, the pod will still be here with a nil netns.
    type podNetnsCache struct {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/pod_cache_test.go

    	}
    }
    
    func TestPodsAppearsWithNilNetnsWhenEnsureIsUsed(t *testing.T) {
    	p := newPodNetnsCache(openNsTestOverride)
    
    	p.Ensure("123")
    
    	found := false
    	snap := p.ReadCurrentPodSnapshot()
    	for k, v := range snap {
    		if k == "123" && v == (WorkloadInfo{}) {
    			found = true
    		}
    	}
    	if !found {
    		t.Fatalf("expected pod 123 to be in the cache")
    	}
    }
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/ztunnelserver_test.go

    	if err != nil {
    		panic(err)
    	}
    	c.Write(data)
    }
    
    type fakePodCache struct {
    	pods map[string]WorkloadInfo
    }
    
    func (f fakePodCache) ReadCurrentPodSnapshot() map[string]WorkloadInfo {
    	return f.pods
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/ztunnelserver.go

    	}
    	return nil
    }
    
    // TODO ctx is unused here
    // nolint: unparam
    func (z *ztunnelServer) sendSnapshot(ctx context.Context, conn *ZtunnelConnection) error {
    	snap := z.pods.ReadCurrentPodSnapshot()
    	for uid, wl := range snap {
    		var resp *zdsapi.WorkloadResponse
    		var err error
    		if wl.Netns != nil {
    			fd := int(wl.Netns.Fd())
    			log.Infof("Sending local pod %s ztunnel", uid)
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 12.4K bytes
    - Viewed (0)
Back to top