postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

relax validation pattern for logicalBackupSchedule

Open hornwind opened this issue 2 years ago • 1 comments

This change will allow to immediately discard invalid values when parsing a logicalBackupSchedule string.

Previously used regular expression ^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$ may pass invalid values to cron, like "00 03 * * 7" Although "00 03 * * 7" may be valid on some systems, but this value will throw an error when applied to kubernetes. https://en.wikipedia.org/wiki/Cron

FYI: kubernetes uses cron implementation from go module "github.com/robfig/cron/v3" https://github.com/robfig/cron/blob/v3/spec.go https://github.com/robfig/cron/blob/v3/parser.go

hornwind avatar Aug 10 '22 19:08 hornwind

In my view this validation should just be removed, as it will fail many valid schedule strings using intervals, named days, ranges, etc. and it would be nearly impossible to properly validate them. See #2323.

bwrobc avatar May 17 '23 08:05 bwrobc