Expand description
The SnapshotSchedule CRD — when a backup runs. Creates Snapshot CRs on a
cron schedule in the SnapshotPolicy’s namespace. ADR-0001 §3.5, ADR-0003 §4.4.
use kopiur_api::{SnapshotScheduleSpec, ConcurrencyPolicy};
// The cluster path: YAML -> JSON value -> typed (never serde_yaml -> typed).
let spec: SnapshotScheduleSpec = serde_json::from_value(serde_json::json!({
"policyRef": { "name": "postgres-data" },
"schedule": { "cron": "H 2 * * *", "jitter": "30m" },
}))
.unwrap();
assert_eq!(spec.policy_ref.as_ref().unwrap().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§
- Schedule
Deletion Spec - Deletion semantics for a schedule’s produced
Snapshots (sub-object per docs/dev/api-conventions.md §4 so future deletion knobs slot in without API breakage). - Schedule
Ref - A pinned schedule slot and (optionally) the
Snapshotit created. - Schedule
Spec - Cron schedule with deterministic jitter, timezone, and concurrency controls.
- Snapshot
Reference - A by-name reference to a
SnapshotCR created by a schedule slot. - Snapshot
Schedule - Auto-generated derived type for SnapshotScheduleSpec via
CustomResource - Snapshot
Schedule Spec - Cron schedule that fires
SnapshotCRs from aSnapshotPolicy. - Snapshot
Schedule Status - Observed state of a
SnapshotSchedule: pinned firing slots and failure run.
Enums§
- Concurrency
Policy - What to do when a previous run is still in flight. Closed enum, default
Forbid. ADR §4.1 (G5/G18).
Functions§
- effective_
on_ schedule_ delete - The effective cascade policy for a schedule:
spec.deletion.onScheduleDeletewhen the sub-object is present, elseRetain. (A default nested under an ABSENT optional sub-object does not materialize server-side — every read goes through this resolver.)