Skip to main content

Module backup_schedule

Module backup_schedule 

Source
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§

BackupReference
A by-name reference to a Backup CR created by a schedule slot. ADR §3.5.
BackupSchedule
Auto-generated derived type for BackupScheduleSpec via CustomResource
BackupScheduleSpec
Cron + configRef. One source of Backup CRs; pausing it doesn’t affect in-flight or completed runs. ADR §3.5.
BackupScheduleStatus
Observed state of a BackupSchedule: pinned firing slots and failure run. ADR §3.5.
ScheduleRef
A pinned schedule slot and (optionally) the Backup it created. ADR §3.5.
ScheduleSpec
Cron schedule with deterministic jitter, timezone, and concurrency controls. ADR §3.5/§4.1.

Enums§

ConcurrencyPolicy
What to do when a previous run is still in flight. Closed enum, default Forbid. ADR §4.1 (G5/G18).