Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for PodsByCreationTime (0.29 sec)

  1. pkg/kubelet/util/sliceutils/sliceutils.go

    	kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
    )
    
    // PodsByCreationTime makes an array of pods sortable by their creation
    // timestamps in ascending order.
    type PodsByCreationTime []*v1.Pod
    
    func (s PodsByCreationTime) Len() int {
    	return len(s)
    }
    
    func (s PodsByCreationTime) Swap(i, j int) {
    	s[i], s[j] = s[j], s[i]
    }
    
    func (s PodsByCreationTime) Less(i, j int) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 13 08:27:42 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  2. pkg/kubelet/util/sliceutils/sliceutils_test.go

    	fooTests := []struct {
    		pods PodsByCreationTime
    		el   int
    	}{
    		{[]*v1.Pod{}, 0},
    		{buildPodsByCreationTime(), 3},
    		{[]*v1.Pod{nil, {}}, 2},
    		{nil, 0},
    	}
    
    	for _, fooTest := range fooTests {
    		r := fooTest.pods.Len()
    		if r != fooTest.el {
    			t.Errorf("returned %d but expected %d for the len of PodsByCreationTime=%s", r, fooTest.el, fooTest.pods)
    		}
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 13 08:27:42 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  3. pkg/kubelet/kubelet.go

    }
    
    // HandlePodAdditions is the callback in SyncHandler for pods being added from
    // a config source.
    func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) {
    	start := kl.clock.Now()
    	sort.Sort(sliceutils.PodsByCreationTime(pods))
    	if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {
    		kl.podResizeMutex.Lock()
    		defer kl.podResizeMutex.Unlock()
    	}
    	for _, pod := range pods {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 14 16:09:17 UTC 2024
    - 126.1K bytes
    - Viewed (1)
Back to top