Skip to main content

Module snapshot_schedule

Module snapshot_schedule 

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

ScheduleDeletionSpec
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).
ScheduleRef
A pinned schedule slot and (optionally) the Snapshot it created.
ScheduleSpec
Cron schedule with deterministic jitter, timezone, and concurrency controls.
SnapshotReference
A by-name reference to a Snapshot CR created by a schedule slot.
SnapshotSchedule
Auto-generated derived type for SnapshotScheduleSpec via CustomResource
SnapshotScheduleSpec
Cron schedule that fires Snapshot CRs from a SnapshotPolicy.
SnapshotScheduleStatus
Observed state of a SnapshotSchedule: pinned firing slots and failure run.

Enums§

ConcurrencyPolicy
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.onScheduleDelete when the sub-object is present, else Retain. (A default nested under an ABSENT optional sub-object does not materialize server-side — every read goes through this resolver.)