Expand description
The SnapshotReplication CRD — copy snapshot manifests (and the content
they reference) from one repository to another on a schedule, wrapping
kopia snapshot migrate (issue #368).
Where RepositoryReplication mirrors a
repository’s blobs verbatim (kopia repository sync-to — same format,
same password, all-or-nothing), SnapshotReplication copies at the
snapshot level: source and destination are BOTH real repository CRs with
their own passwords/formats, and a selector chooses which kopia identities
(and optionally only their latest snapshots) get copied. It is
namespaced (it lives alongside its source, like Maintenance and
RepositoryReplication) and references its repositories via
RepositoryRef — a cluster-scoped ClusterRepository destination is the
flagship consolidation use case.
Each copied snapshot is materialized as a Snapshot CR
(origin: replicated) in this CR’s namespace by the replication mover, with
no ownerReference back to this CR: deleting the SnapshotReplication
never deletes the copies. Only spec.pruning (or deleting the copy
Snapshot CRs themselves) removes replicated data.
Structs§
- Identity
Matcher - One glob match against a kopia identity’s structured
(username, hostname, sourcePath)triple. Every set component must match (AND); an unset component matches anything — but at least one component must be set (webhook-refused otherwise: a fully-empty matcher constrains nothing). - Identity
Selection - Include/exclude lists of identity matchers. An identity is selected when it
matches at least one
includeentry (an empty/absentincludelist means “everything”) AND matches noexcludeentry — exclude always wins. - Migrate
Options - Tuning for
kopia snapshot migrate. Pure scalars + an optional throttle sub-object, soEqbut NOTCopy(Throttleisn’t). - Mirror
Source Pruning - Marker for
Pruning::MirrorSource— no fields today (sub-object for forward-compat, ADR §4.11). - NoPruning
- Marker for
Pruning::None— no fields today; a sub-object so future knobs slot in without API breakage (ADR §4.11). - Selection
Spec - Which snapshots a replication copies. Pure scalars, so
Eq(unlike the parent spec). - Snapshot
Replication - Auto-generated derived type for SnapshotReplicationSpec via
CustomResource - Snapshot
Replication RunStats - Counters from the most recent replication run, written by the mover’s
terminal status patch. Pure scalars, so
Eq. - Snapshot
Replication Spec - Copy selected snapshots from a source repository into a destination repository on a schedule (
kopia snapshot migrate). - Snapshot
Replication Status - Observed state of a
SnapshotReplication.
Enums§
- Policy
Copy Mode - How
kopia snapshot migratetreats the source’s kopia policies. - Pruning
- Exactly one pruning mode for already-replicated copies (externally tagged:
pruning: { retention: {...} }). Absentspec.pruning=Pruning::None. - Snapshot
Replication Phase - Lifecycle phase of a snapshot replication.
Functions§
- component_
glob_ matches - Anchored per-component glob match:
*matches any run of characters (including none),?matches exactly one, everything else is literal. This is the ONE matcher both admission (viavalidate_component_glob) and the replication mover use, so what the webhook admitted and what the mover selects cannot fork. Deliberately dependency-free — no regex, no glob crate. - validate_
component_ glob - Admission-time check that an
IdentityMatchercomponent pattern is onecomponent_glob_matchescan honor: non-empty, no control characters, and none of the glob syntax this matcher deliberately does NOT support ([...]character classes,{...}brace expansion). Rejecting those up front beats silently matching them as literal characters — adata[0-9]that never matches anything is the silent-no-op failure mode this repo designs out.