Remove seconds from scheduled jobs cron format
This commit is contained in:
@@ -205,8 +205,12 @@ func validateConcurrencyPolicy(concurrencyPolicy *batch.ConcurrencyPolicy, fldPa
|
||||
|
||||
func validateScheduleFormat(schedule string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
_, err := cron.Parse(schedule)
|
||||
if err != nil {
|
||||
// TODO soltysh: this should be removed when https://github.com/robfig/cron/issues/58 is fixed
|
||||
tmpSchedule := schedule
|
||||
if len(schedule) > 0 && schedule[0] != '@' {
|
||||
tmpSchedule = "0 " + schedule
|
||||
}
|
||||
if _, err := cron.Parse(tmpSchedule); err != nil {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath, schedule, err.Error()))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user