Skip to content

Commit

Permalink
Use cron.ParseStandard helper
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jul 16, 2019
1 parent 5015a60 commit 3761809
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apis/stash/v1alpha1/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ func (r Restic) IsValid() error {
}
}

parser := cron.NewParser(cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
_, err := parser.Parse(r.Spec.Schedule)
_, err := cron.ParseStandard(r.Spec.Schedule)
if err != nil {
return fmt.Errorf("spec.schedule %s is invalid. Reason: %s", r.Spec.Schedule, err)
}
Expand Down

0 comments on commit 3761809

Please sign in to comment.