Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for AddPodToMesh (0.18 sec)

  1. cni/pkg/nodeagent/server_test.go

    	podIP := netip.MustParseAddr("99.9.9.1")
    	podIPs := []netip.Addr{podIP}
    
    	server := &fakeServer{}
    	server.On("AddPodToMesh",
    		fakeCtx,
    		pod,
    		podIPs,
    		"",
    	).Return(nil)
    
    	server.Start(fakeCtx)
    	m := meshDataplane{
    		kubeClient: fakeClientSet,
    		netServer:  server,
    	}
    
    	err := m.AddPodToMesh(fakeCtx, pod, podIPs, "")
    	assert.NoError(t, err)
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/informers_test.go

    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    		pod,
    		util.GetPodIPsIfPresent(pod),
    		"",
    	).Return(nil)
    
    	server := &meshDataplane{
    		kubeClient: client.Kube(),
    		netServer:  fs,
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Feb 08 01:03:24 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/net_test.go

    	fixture.ipsetDeps.On("addIP",
    		"foo",
    		netip.MustParseAddr("99.9.9.9"),
    		uint8(unix.IPPROTO_TCP),
    		string(podMeta.UID),
    		true,
    	).Return(nil)
    
    	err := netServer.AddPodToMesh(ctx, &corev1.Pod{ObjectMeta: podMeta}, podIPs, "fakenetns")
    	assert.NoError(t, err)
    	assert.Equal(t, 1, ztunnelServer.addedPods.Load())
    }
    
    func TestServerRemovePod(t *testing.T) {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 14.3K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/server.go

    	return s.netServer.ConstructInitialSnapshot(ambientPods)
    }
    
    func (s *meshDataplane) AddPodToMesh(ctx context.Context, pod *corev1.Pod, podIPs []netip.Addr, netNs string) error {
    	var retErr error
    	err := s.netServer.AddPodToMesh(ctx, pod, podIPs, netNs)
    	if err != nil {
    		log.Errorf("failed to add pod to ztunnel: %v", err)
    		if !errors.Is(err, ErrPartialAdd) {
    			return err
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 01:42:30 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/cni-watcher_test.go

    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    		pod,
    		util.GetPodIPsIfPresent(pod),
    		valid.Netns,
    	).Return(nil)
    
    	dpServer := &meshDataplane{
    		kubeClient: client.Kube(),
    		netServer:  fs,
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 08:18:40 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  6. cni/pkg/nodeagent/informers.go

    			if len(podIPs) == 0 {
    				log.Warnf("pod %s does not appear to have any assigned IPs, not capturing", pod.Name)
    				return nil
    			}
    
    			err := s.dataplane.AddPodToMesh(s.ctx, pod, podIPs, "")
    			log.Debugf("AddPodToMesh(%s) returned %v", newPod.Name, err)
    		}
    	case controllers.EventDelete:
    		// TODO: as every pod on our node will come through here, check if pod is annotated?
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Feb 08 01:03:24 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  7. cni/pkg/nodeagent/net.go

    //
    // We always need the IPs, but this is fine because this AddPodToMesh can be called from the CNI plugin as well,
    // which always has the firsthand info of the IPs, even before K8S does - so we pass them separately here because
    // we actually may have them before K8S in the Pod object.
    func (s *NetServer) AddPodToMesh(ctx context.Context, pod *corev1.Pod, podIPs []netip.Addr, netNs string) error {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 12.1K bytes
    - Viewed (1)
  8. cni/pkg/nodeagent/cni-watcher.go

    	}
    	// Note that we use the IP info from the CNI plugin here - the Pod struct as reported by K8S doesn't have this info
    	// yet (because the K8S control plane doesn't), so it will be empty there.
    	err = s.dataplane.AddPodToMesh(ctx, ambientPod, podIps, addCmd.Netns)
    	if err != nil {
    		return err
    	}
    
    	return nil
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Feb 08 18:52:24 GMT 2024
    - 6.1K bytes
    - Viewed (0)
Back to top