Expand description
The BackupSchedule CRD — when a backup runs. Creates Backup CRs on a
cron schedule in the BackupConfig’s namespace. ADR-0001 §3.5, ADR-0003 §4.4.
use kopiur_api::{BackupScheduleSpec, ConcurrencyPolicy};
// The cluster path: YAML -> JSON value -> typed (never serde_yaml -> typed).
let spec: BackupScheduleSpec = serde_json::from_value(serde_json::json!({
"configRef": { "name": "postgres-data" },
"schedule": { "cron": "H 2 * * *", "jitter": "30m" },
}))
.unwrap();
assert_eq!(spec.config_ref.name, "postgres-data");
// GitOps-friendly defaults: no immediate fire, not suspended, Forbid overlap.
assert!(!spec.schedule.run_on_create);
assert!(!spec.schedule.suspend);
assert_eq!(spec.schedule.concurrency_policy, ConcurrencyPolicy::Forbid);Structs§
- Backup
Reference - A by-name reference to a
BackupCR created by a schedule slot. ADR §3.5. - Backup
Schedule - Auto-generated derived type for BackupScheduleSpec via
CustomResource - Backup
Schedule Spec - Cron +
configRef. One source ofBackupCRs; pausing it doesn’t affect in-flight or completed runs. ADR §3.5. - Backup
Schedule Status - Observed state of a
BackupSchedule: pinned firing slots and failure run. ADR §3.5. - Schedule
Ref - A pinned schedule slot and (optionally) the
Backupit created. ADR §3.5. - Schedule
Spec - Cron schedule with deterministic jitter, timezone, and concurrency controls. ADR §3.5/§4.1.
Enums§
- Concurrency
Policy - What to do when a previous run is still in flight. Closed enum, default
Forbid. ADR §4.1 (G5/G18).