Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for PodIPs (0.18 sec)

  1. cni/pkg/util/podutil.go

    func GetPodIPsIfPresent(pod *corev1.Pod) []netip.Addr {
    	var podIPs []netip.Addr
    	if len(pod.Status.PodIPs) != 0 {
    		for _, pip := range pod.Status.PodIPs {
    			ip := netip.MustParseAddr(pip.IP)
    			podIPs = append(podIPs, ip)
    		}
    	} else if len(pod.Status.PodIP) != 0 {
    		ip := netip.MustParseAddr(pod.Status.PodIP)
    		podIPs = append(podIPs, ip)
    	}
    	return podIPs
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed May 01 18:04:40 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  2. cni/pkg/util/podutil_test.go

    		},
    	}
    
    	podIPs := GetPodIPsIfPresent(pod)
    	assert.Equal(t, len(podIPs), 2)
    }
    
    func TestGetPodIPsIfNoPodIPPresent(t *testing.T) {
    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "test",
    			Namespace: "test",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: "derp",
    		},
    		Status: corev1.PodStatus{},
    	}
    
    	podIPs := GetPodIPsIfPresent(pod)
    	assert.Equal(t, len(podIPs), 0)
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed May 01 18:04:40 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/cni-watcher.go

    	var podIps []netip.Addr
    	for _, configuredPodIPs := range addCmd.IPs {
    		// net.ip is implicitly convertible to netip as slice
    		ip, _ := netip.AddrFromSlice(configuredPodIPs.Address.IP)
    		// We ignore the mask of the IPNet - it's fine if the IPNet defines
    		// a block grant of addresses, we just need one for checking routes.
    		podIps = append(podIps, ip)
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Feb 08 18:52:24 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  4. 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 May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/net.go

    	for _, pod := range ambientPods {
    		podIPs := util.GetPodIPsIfPresent(pod)
    		if len(podIPs) == 0 {
    			log.Warnf("pod %s does not appear to have any assigned IPs, not syncing with ipset", pod.Name)
    		} else {
    			err := addPodToHostNSIpset(pod, podIPs, &s.hostsideProbeIPSet)
    			if err != nil {
    				return err
    			}
    			addedIPSnapshot = append(addedIPSnapshot, podIPs...)
    		}
    
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 12.2K bytes
    - Viewed (1)
  6. cni/pkg/nodeagent/net_test.go

    	if v6IP {
    		podStatus = corev1.PodStatus{
    			PodIP:  "e9ac:1e77:90ca:399f:4d6d:ece2:2f9b:3164",
    			PodIPs: []corev1.PodIP{{IP: "e9ac:1e77:90ca:399f:4d6d:ece2:2f9b:3164"}, {IP: "e9ac:1e77:90ca:399f:4d6d:ece2:2f9b:3165"}},
    		}
    	} else {
    		podStatus = corev1.PodStatus{
    			PodIP:  "2.2.2.2",
    			PodIPs: []corev1.PodIP{{IP: "2.2.2.2"}, {IP: "3.3.3.3"}},
    		}
    	}
    
    	return &corev1.Pod{
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  7. cni/pkg/nodeagent/informers.go

    			// the CNI plugin chain, and have a PodIP.
    			//
    			// If PodIPs exists, it is preferred, otherwise fallback to PodIP.
    			//
    			// If we get to this point and have a pod that really and truly has no IP in either of those,
    			// it's not routable at this point and something is wrong/we should discard this event.
    			podIPs := util.GetPodIPsIfPresent(pod)
    			if len(podIPs) == 0 {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Feb 08 01:03:24 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  8. 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
    		}
    		retErr = err
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/informers_test.go

    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "test",
    			Namespace: "test",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    		Status: corev1.PodStatus{
    			PodIPs: []corev1.PodIP{
    				{
    					IP: "11.1.1.12",
    				},
    			},
    		},
    	}
    	ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test"}}
    
    	client := kube.NewFakeClient(ns, pod)
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Feb 08 01:03:24 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  10. common-protos/k8s.io/api/core/v1/generated.proto

      optional string podIP = 6;
    
      // podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must
      // match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list
      // is empty if no IPs have been allocated yet.
      // +optional
      // +patchStrategy=merge
      // +patchMergeKey=ip
      repeated PodIP podIPs = 12;
    
    Plain Text
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 255.8K bytes
    - Viewed (0)
Back to top