Skip to content

Commit

Permalink
Merge pull request #141 from vshn/feat/random-pg-schedule
Browse files Browse the repository at this point in the history
Add randomized default maintenance and backup schedules for PostgreSQL by VSHN
  • Loading branch information
glrf authored Apr 28, 2023
2 parents 1af5398 + 91afeaf commit f35ceab
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions apis/vshn/v1/dbaas_vshn_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@ type VSHNDBaaSSchedulingSpec struct {
// VSHNDBaaSMaintenanceScheduleSpec contains settings to control the maintenance of an instance.
type VSHNDBaaSMaintenanceScheduleSpec struct {
// +kubebuilder:validation:Enum=monday;tuesday;wednesday;thursday;friday;saturday;sunday
// +kubebuilder:default="tuesday"

// DayOfWeek specifies at which weekday the maintenance is held place.
// Allowed values are [monday, tuesday, wednesday, thursday, friday, saturday, sunday]
DayOfWeek string `json:"dayOfWeek,omitempty"`

// +kubebuilder:validation:Pattern="^([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"
// +kubebuilder:default="22:30:00"

// TimeOfDay for installing updates in UTC.
// Format: "hh:mm:ss".
Expand Down Expand Up @@ -143,7 +141,6 @@ type VSHNDBaaSNetworkSpec struct {

type VSHNPostgreSQLBackup struct {
// +kubebuilder:validation:Pattern=^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$
// +kubebuilder:default="0 22 * * *"
Schedule string `json:"schedule,omitempty"`

// +kubebuilder:validation:Pattern="^[1-9][0-9]*$"
Expand Down
3 changes: 0 additions & 3 deletions crds/vshn.appcat.vshn.io_vshnpostgresqls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ spec:
type: integer
x-kubernetes-int-or-string: true
schedule:
default: 0 22 * * *
pattern: ^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$
type: string
type: object
Expand All @@ -59,7 +58,6 @@ spec:
description: Maintenance contains settings to control the maintenance of an instance.
properties:
dayOfWeek:
default: tuesday
description: DayOfWeek specifies at which weekday the maintenance is held place. Allowed values are [monday, tuesday, wednesday, thursday, friday, saturday, sunday]
enum:
- monday
Expand All @@ -71,7 +69,6 @@ spec:
- sunday
type: string
timeOfDay:
default: "22:30:00"
description: 'TimeOfDay for installing updates in UTC. Format: "hh:mm:ss".'
pattern: ^([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$
type: string
Expand Down
3 changes: 0 additions & 3 deletions tests/golden/vshn/appcat/appcat/20_xrd_vshn_postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ spec:
type: integer
x-kubernetes-int-or-string: true
schedule:
default: 0 22 * * *
pattern: ^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))
(\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1]))
(\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$
Expand All @@ -73,7 +72,6 @@ spec:
of an instance.
properties:
dayOfWeek:
default: tuesday
description: DayOfWeek specifies at which weekday the maintenance
is held place. Allowed values are [monday, tuesday, wednesday,
thursday, friday, saturday, sunday]
Expand All @@ -87,7 +85,6 @@ spec:
- sunday
type: string
timeOfDay:
default: '22:30:00'
description: 'TimeOfDay for installing updates in UTC. Format:
"hh:mm:ss".'
pattern: ^([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$
Expand Down

0 comments on commit f35ceab

Please sign in to comment.