Skip to content

Commit

Permalink
Schedule Unpause Trigger Config Design
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Sep 15, 2023
1 parent c85638d commit 1e52b7f
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions design/schedule-unpaused-triggers-config_design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Schedule Unpaused Triggers Config Design
## Abstract
User want to configure what happens when schedule is unpaused. Either run backup immediately or at the next cron schedule. This design proposes to add a new field to the schedule spec to allow user to configure the behavior

## Background
Currently, the default behavior is to run the trigger immediately and may not be desired by all users (https://github.com/vmware-tanzu/velero/issues/6517)

## Goals
- Make schedule unpaused behavior configurable

## Non Goals
- Changing the default behavior


## High-Level Design
Add a new field with to the schedule spec to allow user to configure the behavior defaulting to prior behavior of triggering backup immediately.

## Detailed Design
### CLI Changes
`velero schedule unpause` will now take an optional bool flag `--unpause-triggers` to allow user to override the behavior configured in the schedule spec.

`velero schedule unpause schedule-1 --unpause-triggers=false` will unpause the schedule but not trigger the backup immediately.

`velero schedule unpause schedule-1 --unpause-triggers=true` will unpause the schedule and trigger the backup immediately.

`velero schedule unpause schedule-1` will unpause the schedule and trigger the backup immediately. This is the same behavior as before.

### API Changes
```
// ScheduleSpec defines the specification for a Velero schedule
type ScheduleSpec struct {
// Template is the definition of the Backup to be run
// on the provided schedule
Template BackupSpec `json:"template"`
// Schedule is a Cron expression defining when to run
// the Backup.
Schedule string `json:"schedule"`
// UseOwnerReferencesBackup specifies whether to use
// OwnerReferences on backups created by this Schedule.
// +optional
// +nullable
UseOwnerReferencesInBackup *bool `json:"useOwnerReferencesInBackup,omitempty"`
// Paused specifies whether the schedule is paused or not
// +optional
Paused bool `json:"paused,omitempty"`
// UnpauseTriggers specifies whether to trigger backup immediately when schedule is unpaused
// +kubebuilder:default:=true
// +kubebuilder:validation:Optional
UnpauseTriggers bool `json:"unpauseTriggers,omitempty"`
}
```

## Alternatives Considered

`velero server` flags to configure the behavior. This is not ideal as it is a global setting. This behavior should be configurable per schedule.


## Security Considerations
None

## Compatibility
Upon upgrade, the new field will be added to the schedule spec automatically and will default to the prior behavior of triggering backup immediately.

Since this is a new field, it will be ignored by older versions of velero.

## Implementation
TBD

## Open Issues
A discussion of issues relating to this proposal for which the author does not know the solution. This section may be omitted if there are none.

0 comments on commit 1e52b7f

Please sign in to comment.