[Draft] D8 snapshot unified contract#409
Open
kneumoin wants to merge 11 commits into
Open
Conversation
…te-snapshotter.deckhouse.io
…eData contract Target the storage-foundation.deckhouse.io/v1alpha1 DataImport and build a PopulateData spec (mode + snapshotRef + storageParams sourced from the archived volume info) instead of the removed Mode A dataArtifactType/targetRef; read the produced artifact from status.data.artifact.
…khouse.io The download path (and d8 data export) targets the storage-foundation DataExport CRD now served on the cluster. targetRef already carries kind, which the storage-foundation contract requires; the legacy resource field is pruned by the CRD's preserveUnknownFields: false.
…tus parsing, spec.mode import marker, drop snapshot-class
…t; record archive dir layout inventory
…yout (variant A) before 2b
…entity in ParseNodeStatus; sync stage2 plan to NodeData
… SnapshotContent reads
…hotContent test scaffolding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
d8 CLI: migrate snapshot commands to the unified-snapshot contract
Context
Aligns
d8 snapshot(download / upload(import) / restore / describe) with the unifiedsnapshot contract. Contract SSOT:
docs/2026-06-29-unified-snapshots-overview.md.PR base is the d8-snapshot branch (tip
cdc2e9b); the contract changes sit on top of it.Old archives / on-disk format backward compatibility are intentionally not supported.
What changes
Stage 1 — API group migration
Snapshot/SnapshotContent→ groupstate-snapshotter.deckhouse.io.DataImportimport path reworked to thestorage-foundationPopulateData contract.DataExport→ groupstorage-foundation.deckhouse.io.Stage 2a — import marker + cleanup
spec.source.import: {}→spec.mode: Import(dedicatedSnapshotModetype;an unknown / non-string
modeis an error).snapshotClassNamefromcreate(the--snapshot-classflag is removed).ParseNodeStatus+NodeData/SourceRefIdentity(actual wire contract is
status.data.{source,artifact,...}; the legacySnapshotDataBindingtype is no longer used).status.sourceRef.uidis required; the fullSnapshotIdentity(
apiVersion/kind/namespace/name/uid) is validated at the start ofParseNodeStatus.status.sourceRef.namespaceis required for namespaced sources, but legitimately absentfor the cluster-scoped
v1/Namespacesource (root capture Snapshot).ArchiveNodeDirNameisremoved; the readable directory base is
SourceRef.Name(falling back toNode.Name).Stage 2b — download/import without SnapshotContent
status.sourceRef/status.data/status.childrenSnapshotRefs; cluster-scopedSnapshotContentis no longer read.source.Nodemodel:SourceRef *SourceRefIdentity,Data *NodeData, plusIdentity(),IsVolumeLeaf(),DirBaseName().UID(archiveSnapshotYAML.UIDreplaces the string
SourceRef).Readycondition; removedwaitSnapshotContentReady,snapshotContentGVR, and the old content conditions(
ManifestsReady/VolumesReady/ChildrenReady).aggapi.ContentManifestsDownload— the last runtime path tosnapshotcontents.Invariants (enforced by tests)
Get/List/WatchofSnapshotContentin the download/import paths.status.data) per node — Variant A.Testing
go test ./internal/snapshot/...— green (all fixtures moved offSnapshotContenttonamespaced status / unstructured objects).
TestPipeline_Download_NeverReadsSnapshotContent: wraps the fakeclient with an interceptor that fails on any access to
SnapshotContent, then runs thefull download over an aggregator + orphan-leaf tree (the scenario that previously resolved
via
boundSnapshotContentName → SnapshotContent).go vet ./internal/snapshot/...— clean.golangci-lint run ./internal/snapshot/...— 0 issues.Real-cluster e2e (
download → upload(import) → restore) is out of scope for this PR(Stage 3:
linux/amd64cross-build + deploy to a node).Out of scope / follow-ups
DataImporthardening (PopulateData: complete onCompleted=True+ presence ofstatus.data.artifact) — tracked separately to keep the diff focused.d8 snapshot restorestill readsstatus.boundSnapshotContentName(the Snapshot's ownstatus, not a
Getof aSnapshotContentobject); fully removing the legacy field is separate.