Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for byJobStartTime (0.18 sec)

  1. pkg/controller/cronjob/utils.go

    	return scheduledTime.Unix() / 60
    }
    
    // byJobStartTime sorts a list of jobs by start timestamp, using their names as a tie breaker.
    type byJobStartTime []*batchv1.Job
    
    func (o byJobStartTime) Len() int      { return len(o) }
    func (o byJobStartTime) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
    
    func (o byJobStartTime) Less(i, j int) bool {
    	if o[i].Status.StartTime == nil && o[j].Status.StartTime != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  2. pkg/controller/cronjob/utils_test.go

    			name:     "both have non-nil, different start time",
    			input:    []*batchv1.Job{aSetLater, bSet},
    			expected: []*batchv1.Job{bSet, aSetLater},
    		},
    	}
    
    	for _, testCase := range testCases {
    		sort.Sort(byJobStartTime(testCase.input))
    		if !reflect.DeepEqual(testCase.input, testCase.expected) {
    			t.Errorf("case: '%s', jobs not sorted as expected", testCase.name)
    		}
    	}
    }
    
    func TestMostRecentScheduleTime(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  3. pkg/controller/cronjob/cronjob_controllerv2.go

    		return updateStatus
    	}
    	logger := klog.FromContext(ctx)
    	logger.V(4).Info("Cleaning up jobs from CronJob list", "deletejobnum", numToDelete, "jobnum", len(js), "cronjob", klog.KObj(cj))
    
    	sort.Sort(byJobStartTime(js))
    	for i := 0; i < numToDelete; i++ {
    		logger.V(4).Info("Removing job from CronJob list", "job", js[i].Name, "cronjob", klog.KObj(cj))
    		if deleteJob(logger, cj, js[i], jm.jobControl, jm.recorder) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 29.2K bytes
    - Viewed (0)
Back to top