Skip to content

Commit 2582b93

Browse files
authored
MaintenanceWindow CRD validation reflects the implementation (#2731)
1 parent 2f7e3ee commit 2582b93

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

charts/postgres-operator/crds/postgresqls.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ spec:
226226
type: array
227227
items:
228228
type: string
229-
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
229+
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
230230
masterServiceAnnotations:
231231
type: object
232232
additionalProperties:

manifests/postgresql.crd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ spec:
224224
type: array
225225
items:
226226
type: string
227-
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
227+
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
228228
masterServiceAnnotations:
229229
type: object
230230
additionalProperties:

pkg/apis/acid.zalan.do/v1/util_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ var maintenanceWindows = []struct {
123123
{"expect error as weekday is empty", []byte(`":00:00-10:00"`), MaintenanceWindow{}, errors.New(`could not parse weekday: incorrect weekday`)},
124124
{"expect error as maintenance window set seconds", []byte(`"Mon:00:00:00-10:00:00"`), MaintenanceWindow{}, errors.New(`incorrect maintenance window format`)},
125125
{"expect error as 'To' time set seconds", []byte(`"Mon:00:00-00:00:00"`), MaintenanceWindow{}, errors.New("could not parse end time: incorrect time format")},
126+
// ideally, should be implemented
127+
{"expect error as 'To' has a weekday", []byte(`"Mon:00:00-Fri:00:00"`), MaintenanceWindow{}, errors.New("could not parse end time: incorrect time format")},
126128
{"expect error as 'To' time is missing", []byte(`"Mon:00:00"`), MaintenanceWindow{}, errors.New("incorrect maintenance window format")}}
127129

128130
var postgresStatus = []struct {

0 commit comments

Comments
 (0)