Skip to content

Commit 468ca7d

Browse files
alexpearcemnencia
authored andcommitted
Clarify ScheduledBackup.spec.schedule format.
The Kubernetes CronJob schedule syntax follows the five-field unix-style crontab syntax. The robfig/cron package uses a six-field syntax where the additional fields denotes seconds. Signed-off-by: Alex Pearce <alex@alexpearce.me>
1 parent ec21147 commit 468ca7d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

api/v1/scheduledbackup_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ type ScheduledBackupSpec struct {
3131
// If the first backup has to be immediately start after creation or not
3232
Immediate *bool `json:"immediate,omitempty"`
3333

34-
// The schedule follows the same format used in Kubernetes CronJobs,
34+
// The schedule does not follow the same format used in Kubernetes CronJobs
35+
// as it includes an additional seconds specifier,
3536
// see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
3637
Schedule string `json:"schedule"`
3738

config/crd/bases/postgresql.cnpg.io_scheduledbackups.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ spec:
7272
creation or not
7373
type: boolean
7474
schedule:
75-
description: The schedule follows the same format used in Kubernetes
76-
CronJobs, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
75+
description: The schedule does not follow the same format used in
76+
Kubernetes CronJobs as it includes an additional seconds specifier,
77+
see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
7778
type: string
7879
suspend:
7980
description: If this backup is suspended or not

docs/src/api_reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ Name | Description
883883
-------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------
884884
`suspend ` | If this backup is suspended or not | *bool
885885
`immediate ` | If the first backup has to be immediately start after creation or not | *bool
886-
`schedule ` | The schedule follows the same format used in Kubernetes CronJobs, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format - *mandatory* | string
886+
`schedule ` | The schedule does not follow the same format used in Kubernetes CronJobs as it includes an additional seconds specifier, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format - *mandatory* | string
887887
`cluster ` | The cluster to backup | [LocalObjectReference](#LocalObjectReference)
888888
`backupOwnerReference` | Indicates which ownerReference should be put inside the created backup resources.<br /> - none: no owner reference for created backup objects (same behavior as before the field was introduced)<br /> - self: sets the Scheduled backup object as owner of the backup<br /> - cluster: set the cluster as owner of the backup<br /> | string
889889

0 commit comments

Comments
 (0)