Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ParseStandard (0.24 sec)

  1. pkg/controller/cronjob/utils_test.go

    	logger, _ := ktesting.NewTestContext(t)
    	// schedule is hourly on the hour
    	schedule := "0 * * * ?"
    
    	ParseSchedule := func(schedule string) cron.Schedule {
    		sched, err := cron.ParseStandard(schedule)
    		if err != nil {
    			t.Errorf("Error parsing schedule: %#v", err)
    			return nil
    		}
    		return sched
    	}
    	recorder := record.NewFakeRecorder(50)
    	// T1 is a scheduled start time of that schedule
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  2. pkg/controller/cronjob/utils.go

    	if now.Before(t1) {
    		return earliestTime, nil, missedSchedules, nil
    	}
    	if now.Before(t2) {
    		return earliestTime, &t1, missedSchedules, nil
    	}
    
    	// It is possible for cron.ParseStandard("59 23 31 2 *") to return an invalid schedule
    	// minute - 59, hour - 23, dom - 31, month - 2, and dow is optional, clearly 31 is invalid
    	// In this case the timeBetweenTwoSchedules will be 0, and we error out the invalid schedule
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  3. pkg/controller/cronjob/cronjob_controllerv2.go

    		// schedule changed, change the requeue time, pass nil recorder so that syncCronJob will output any warnings
    		sched, err := cron.ParseStandard(formatSchedule(newCJ, nil))
    		if err != nil {
    			// this is likely a user error in defining the spec value
    			// we should log the error and not reconcile this cronjob until an update to spec
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 09 03:34:25 UTC 2024
    - 29.2K bytes
    - Viewed (0)
  4. pkg/apis/batch/validation/validation.go

    	}
    
    	return allErrs
    }
    
    func validateScheduleFormat(schedule string, allowTZInSchedule bool, timeZone *string, fldPath *field.Path) field.ErrorList {
    	allErrs := field.ErrorList{}
    	if _, err := cron.ParseStandard(schedule); err != nil {
    		allErrs = append(allErrs, field.Invalid(fldPath, schedule, err.Error()))
    	}
    	switch {
    	case allowTZInSchedule && strings.Contains(schedule, "TZ") && timeZone != nil:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 08 16:43:24 UTC 2024
    - 51.2K bytes
    - Viewed (0)
Back to top