Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for getPodIP (0.22 sec)

  1. pkg/registry/core/pod/strategy.go

    	if err != nil {
    		return nil, err
    	}
    	pod := obj.(*api.Pod)
    	if pod == nil {
    		return nil, fmt.Errorf("Unexpected object type: %#v", pod)
    	}
    	return pod, nil
    }
    
    // getPodIP returns primary IP for a Pod
    func getPodIP(pod *api.Pod) string {
    	if pod == nil {
    		return ""
    	}
    	if len(pod.Status.PodIPs) > 0 {
    		return pod.Status.PodIPs[0].IP
    	}
    
    	return ""
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 17:51:48 UTC 2024
    - 29.8K bytes
    - Viewed (0)
  2. pkg/kubelet/pleg/generic.go

    	newState := getContainerState(newPod, cid)
    	return generateEvents(pid, cid.ID, oldState, newState)
    }
    
    func (g *GenericPLEG) cacheEnabled() bool {
    	return g.cache != nil
    }
    
    // getPodIP preserves an older cached status' pod IP if the new status has no pod IPs
    // and its sandboxes have exited
    func (g *GenericPLEG) getPodIPs(pid types.UID, status *kubecontainer.PodStatus) []string {
    	if len(status.IPs) != 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  3. pkg/registry/core/pod/strategy_test.go

    						{IP: "10.0.0.10"},
    						{IP: "10.0.0.20"},
    					},
    				},
    			},
    			expectedIP: "10.0.0.10",
    		},
    	}
    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			podIP := getPodIP(tc.pod)
    			if podIP != tc.expectedIP {
    				t.Errorf("expected pod ip:%v does not match actual %v", tc.expectedIP, podIP)
    			}
    		})
    	}
    }
    
    type fakeTransport struct {
    	val string
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 76.2K bytes
    - Viewed (0)
Back to top