Expand description
Well-known wire-contract strings: the finalizer, labels, annotations, and condition types that form kopiur’s public Kubernetes surface (ADR §4.5, ADR-0005 §2/§14(c)).
These live in kopiur-api — not the controller — because they are part of
the API contract itself: external tooling (the kubectl kopiur plugin,
GitOps health checks, user automation) must agree on them byte-for-byte
with the operator. Controller-internal reasons/actions/deadlines stay in
kopiur-controller’s own consts module.
Constants§
- ALLOW_
IDENTITY_ CHANGE_ ANNOTATION - Acknowledges an intentional identity-affecting change on UPDATE. Two surfaces share it:
- ALLOW_
MASS_ DELETION_ ANNOTATION - Acknowledges a mass-deletion wave on a
Repository/ClusterRepository. Value: an RFC3339 timestamp. A HELD external deletion is released iff its Snapshot’smetadata.deletionTimestamp<= this value — “I approve what is pending NOW”. Deliberately VALUED (unlike the presence-only allow-identity-change ack, consumed at a single admission instant): this annotation is read continuously by the controller, so a presence-only ack left behind (or committed to Git) would disarm the breaker forever. With the timestamp, a stale ack is inert against any LATER wave, nothing ever needs to remove it, and the operator never edits user metadata. The controller clamps the effective value to <= its own now (clock-skew guard); an unparseable value is ignored (Warning event on the repository). - API_
VERSION - The API version string for kopiur CRDs (used in mover
TargetRefs andkubectl -o name-style output). - AZURE_
WORKLOAD_ IDENTITY_ LABEL - Pod label opting a mover pod into the azure-workload-identity mutating
webhook: pods carrying
azure.workload.identity/use: "true"and running as a federatedServiceAccountgetAZURE_TENANT_ID/AZURE_CLIENT_ID/AZURE_FEDERATED_TOKEN_FILE(and the projected token volume) injected — exactly the env kopia’s azure backend binds its credential flags to. Stamped by the operator (and the CLI’s browse sessions) on every mover pod for a repository whose azure backend usesauth.workloadIdentity. Lives here because the operator andkubectl kopiurmust agree on it byte-for-byte. - AZURE_
WORKLOAD_ IDENTITY_ LABEL_ VALUE - The
AZURE_WORKLOAD_IDENTITY_LABELvalue opting the pod in. - CONFIG_
LABEL - Label naming the
SnapshotPolicyaSnapshotwas produced from. - DEFAULT_
CATALOG_ REFRESH_ INTERVAL - Default catalog re-scan cadence when
spec.catalog.refreshIntervalis unset: how often aReadyrepository re-lists its kopia snapshots to materialize (and expire)origin: discoveredSnapshotCRs. Part of the documented API contract (field-reference), so it lives here rather than in the controller. - DEFAULT_
FAILED_ JOBS_ HISTORY_ LIMIT - Default
SnapshotSchedule.spec.failedJobsHistoryLimitwhen unset: how manyFailedSnapshotCRs from a schedule to retain (the rest are pruned). Bounds failure history so a schedule firing against a persistently-failing precondition or backend doesn’t accumulateFailedCRs forever. GFS retention applies only to successful snapshots, so this is the only bound on failures (ADR-0003). Part of the documented API contract, so it lives here, not in the controller. - DEFAULT_
HEALTH_ PROBE_ FAILURE_ THRESHOLD - Default
spec.health.probe.failureThreshold: how many consecutive failing probes must accumulate before the loudRepositoryVanished/BackendReachable=Falsecondition is raised and an event fired. Debounces a single transient blip (an S3 list-after-delete race, a NAS reboot, a credential-rotation moment) from alarming on-call or nudging a destructive manual recreate. - DEFAULT_
HEALTH_ PROBE_ INTERVAL - Default
spec.health.probe.intervalwhen unset: how often an opt-in backend health probe re-connects aReadyrepository to confirm the kopia repository still exists at the backend. Off by default; only meaningful oncespec.health.probe.enabled: true. Conservative — a vanished/unreachable repository is rare and the probe runs a short mover Job — so it leans long. Part of the documented API contract, so it lives here, not in the controller. - DEFAULT_
INDEX_ BLOB_ WARN_ THRESHOLD - Default
spec.health.indexBlobWarnThreshold: the index-blob count above which the reconciler warns that maintenance isn’t keeping up. A freshly-compacted repo sits near zero; a wedged-maintenance repo climbs unbounded (a real one reached 1448). Conservative so it only fires when maintenance is clearly behind. Overridable per-repo;0disables the warning. Part of the documented API contract, so it lives here rather than in the controller. - DEFAULT_
MASS_ DELETION_ THRESHOLD - Default
spec.deletionProtection.threshold(0 disables). 10 pending external destructive deletions is far above legitimate manual cleanup but far below a tooling-driven cascade (the motivating incident was ~600). - INDEX_
BLOB_ HEALTH_ CONDITION Repository/ClusterRepositorycondition reporting content-index-blob health (ADR-0005 §13).True= healthy (count under threshold);Falsewith reasonTooManyIndexBlobs= the index is growing unbounded because maintenance isn’t compacting. NON-BLOCKING: the repository staysReadyand GitOps health gates are not tripped — it’s a degradation warning, not an outage. Wire-visible (the kubectl plugin’sstatusreads it).- MAINTENANCE_
CONFIGURED_ CONDITION Repository/ClusterRepositorycondition recording whether aMaintenancecovers it (ADR §3.7). Wire-visible: GitOps health checks and the kubectl plugin’sstatusread it.- MANAGED_
BY_ LABEL - The standard
app.kubernetes.io/managed-bylabel key. Stamped on every operator-created object (mover Jobs, work-spec ConfigMaps, cache PVC, minted mover SA/RoleBinding, projected credential Secret, CSI VolumeSnapshots) so Argo/Flux recognize them as controller-owned and neither prune nor report themOutOfSync(ADR-0005 §14(c)). - MANAGED_
BY_ VALUE - The
MANAGED_BY_LABELvalue identifying kopiur-managed objects. - MASS_
DELETION_ HELD_ CONDITION Repository/ClusterRepositorycondition: pending external destructive deletions for this repository are at/above the breaker threshold and held.- MIN_
CATALOG_ REFRESH_ INTERVAL - Floor for
spec.catalog.refreshInterval, enforced at admission. Each re-scan of an object-store repository runs a short mover Job; anything faster than this is Job churn with no operational value. - MIN_
HEALTH_ PROBE_ INTERVAL - Floor for
spec.health.probe.interval, enforced at admission. Each probe runs a short mover Job (object-store / volume-backed) or an in-process connect; anything faster than this is Job churn with no operational value. Shares the 30s floor with the catalog re-scan for the same reason. - OP_
LABEL - Label naming the operation a mover
Jobperforms, for Jobs whose owning CR doesn’t record the Job name in status (e.g.Restore). Values:OP_RESTORE,OP_RESTORE_TARGET. - OP_
RESTORE OP_LABELvalue for aRestore’s mover Job.- OP_
RESTORE_ TARGET OP_LABELvalue for aRestore’s operator-created target PVC.- ORIGIN_
LABEL - Label mirroring a
Snapshot’s origin (scheduled/manual/discovered). - PRUNED_
BY_ ANNOTATION - Marks a
Snapshotthe OPERATOR is deleting as part of its own lifecycle, stamped immediately before the delete call. Values:PrunedByannotation values (retention,failed-history). The Snapshot finalizer uses it to distinguish Kopiur’s own prunes from external deletions (GC cascades, kubectl, third-party controllers); external destructive deletions are subject to the schedule-cascade guard and the mass-deletion breaker, operator prunes are not. Any unrecognized value is treated as EXTERNAL (fail-safe). Wire-visible: users and tooling may read it on terminating CRs. - READY_
CONDITION - kstatus-compliant standard condition types (ADR-0005 §2) so
kubectl wait --for=condition=Readyand Flux/Argo health checks work natively against every reconciled kopiur CRD. The headline readiness condition. - RECONCILING_
CONDITION - Set
Truewhile a reconcile is making progress toward Ready. - REPOSITORY_
UID_ LABEL - Label keying a discovered
Snapshotto the owning Repository UID (dedup). - RUN_
MODE_ ANNOTATION - Companion annotation selecting the run kind:
quick(default) orfull(seekopiur_api::maintenance::ManualRunMode). - RUN_
REQUESTED_ ANNOTATION - Annotation requesting an out-of-band
Maintenancerun NOW (Flux-style reconcile trigger). Value: an RFC3339 timestamp; a NEW timestamp requests a new run (re-applying the same value is a no-op once handled). Usable from barekubectl annotateorkubectl kopiur maintenance run. - SCHEDULE_
LABEL - Label naming the
SnapshotSchedulethat fired a scheduledSnapshot(selector for a schedule’s own children, distinct fromCONFIG_LABELunderpolicySelectorfan-out). - SESSION_
BROWSE SESSION_LABELvalue for a read-only browse session.- SESSION_
LABEL - Label marking a mover
Jobas an interactive data-plane session pod (spawned bykubectl kopiur browse/ls/cat/download, not by the operator). Value:SESSION_BROWSE. Wire-visible: the CLI finds (and reuses) a warm session by this selector, andsession enddeletes by it. - SESSION_
REPO_ LABEL - Label keying a session
Jobto the repository it holds open, as<kind>-<name>(e.g.Repository-nas). One warm session per repository: the CLI selects on this so two snapshots in the same repository share a pod. - SKIP_
SNAPSHOT_ CLEANUP_ ANNOTATION - Repo-offline escape hatch: when present, the finalizer is removed without
contacting the repository, the snapshot is recorded orphaned, and a
SnapshotOrphanedevent is emitted (ADR §4.5). - SNAPSHOT_
CLEANUP_ FINALIZER - The finalizer every
Snapshotcarries so the operator can run snapshot cleanup before the CR is removed (ADR §4.5 / SKILL “Snapshot lifecycle = CR lifecycle”). - SNAPSHOT_
ID_ LABEL - Label keying a discovered
Snapshotto its kopia snapshot id (dedup, §2.1). - STALLED_
CONDITION - Set
Truewhen the resource is stuck and won’t progress without intervention (mapped from a terminalErrorClass::Terminalfailure).
Functions§
- effective_
failed_ jobs_ history_ limit - The effective failed-history limit:
failedJobsHistoryLimitwhen set, elseDEFAULT_FAILED_JOBS_HISTORY_LIMIT.Some(0)keeps no failed snapshots. - effective_
mass_ deletion_ threshold - The effective mass-deletion breaker threshold:
deletionProtection.thresholdwhen set, elseDEFAULT_MASS_DELETION_THRESHOLD.Some(0)disables the breaker.