v1alpha1

package
v0.33.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 provides typed Go structs for the state-snapshotter CRDs consumed by the d8 snapshot commands. Only the state-snapshotter.deckhouse.io/v1alpha1 group is represented here (Snapshot, SnapshotContent). Per-node manifests are read through the aggregated subresource API (see internal/snapshot/aggapi) rather than directly from ManifestCheckpoint CRDs.

Index

Constants

View Source
const (
	StorageGroup = "state-snapshotter.deckhouse.io"
	Version      = "v1alpha1"
)

API group and version constants for the snapshot CRD group.

View Source
const (
	// AnnotationSourceRef is the producer-owned annotation carrying a captured node's source identity.
	AnnotationSourceRef = "state-snapshotter.deckhouse.io/source-ref"
	// AnnotationImportSourceRef is the CLI-owned annotation preserving the original archive
	// source identity on an import-mode marker.
	AnnotationImportSourceRef = "snapshot.deckhouse.io/import-source-ref"
)

Variables

This section is empty.

Functions

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

AddToScheme registers the state-snapshotter.deckhouse.io snapshot CRD types into the given scheme. Call once during controller-runtime client setup.

Types

type ImportSourceRef

type ImportSourceRef struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
}

ImportSourceRef is the canonical annotation payload preserved from snapshot.yaml. Source namespace and UID are intentionally absent because the archive sourceObjectRef contract identifies the source only by apiVersion, kind, and name.

type Snapshot

type Snapshot struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SnapshotSpec   `json:"spec,omitempty"`
	Status SnapshotStatus `json:"status,omitempty"`
}

Snapshot requests a namespace state/configuration snapshot.

func (*Snapshot) DeepCopyInto

func (s *Snapshot) DeepCopyInto(out *Snapshot)

DeepCopyInto copies all fields of s into out, making a fully independent copy.

func (*Snapshot) DeepCopyObject

func (s *Snapshot) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

type SnapshotChildRef

type SnapshotChildRef struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
}

SnapshotChildRef identifies one child snapshot object in the run tree. apiVersion and kind are required; the consumer resolves the object with a single Get.

type SnapshotContent

type SnapshotContent struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SnapshotContentSpec   `json:"spec,omitempty"`
	Status SnapshotContentStatus `json:"status,omitempty"`
}

SnapshotContent holds the result of a snapshot run.

func (*SnapshotContent) DataRefList

func (s *SnapshotContent) DataRefList() []SnapshotDataBinding

DataRefList returns status.dataRef as a slice of length 0 or 1. Variant A keeps cardinality ≤1 on a node; this bridge lets callers iterate the single binding without special-casing the nil pointer.

func (*SnapshotContent) DeepCopyInto

func (s *SnapshotContent) DeepCopyInto(out *SnapshotContent)

DeepCopyInto copies all fields of s into out, making a fully independent copy.

func (*SnapshotContent) DeepCopyObject

func (s *SnapshotContent) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

type SnapshotContentChildRef

type SnapshotContentChildRef struct {
	Name string `json:"name"`
}

SnapshotContentChildRef identifies one child SnapshotContent in the snapshot tree. SnapshotContent is cluster-scoped; the ref is name-only and must not carry a namespace.

type SnapshotContentList

type SnapshotContentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SnapshotContent `json:"items"`
}

SnapshotContentList is a list of SnapshotContent objects.

func (*SnapshotContentList) DeepCopyObject

func (s *SnapshotContentList) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

type SnapshotContentSpec

type SnapshotContentSpec struct {
	// DeletionPolicy controls whether the controller may delete this SnapshotContent.
	DeletionPolicy string `json:"deletionPolicy,omitempty"`
}

SnapshotContentSpec describes the desired state of a SnapshotContent.

type SnapshotContentStatus

type SnapshotContentStatus struct {
	// ManifestCheckpointName is the cluster-scoped ManifestCheckpoint name once manifest capture has persisted.
	ManifestCheckpointName string `json:"manifestCheckpointName,omitempty"`

	// ChildrenSnapshotContentRefs lists direct child SnapshotContent objects in the snapshot tree.
	ChildrenSnapshotContentRefs []SnapshotContentChildRef `json:"childrenSnapshotContentRefs,omitempty"`

	// DataRef is the single PVC-target-to-data-artifact binding for this logical snapshot node.
	// Variant A (cardinality ≤1): a node carries at most one data artifact; multiple volumes are
	// represented as separate child volume nodes (childrenSnapshotContentRefs), never as a list here.
	DataRef *SnapshotDataBinding `json:"dataRef,omitempty"`

	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SnapshotContentStatus carries the latest observations for a SnapshotContent.

type SnapshotDataArtifactRef

type SnapshotDataArtifactRef struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
}

SnapshotDataArtifactRef points to a durable data artifact produced by the data path (e.g. a VolumeSnapshotContent). Must not reference transient execution requests.

type SnapshotDataBinding

type SnapshotDataBinding struct {
	// TargetUID identifies the captured PersistentVolumeClaim (its UID) backing this node's data.
	TargetUID string `json:"targetUID"`

	// Target identifies the PVC (and related metadata) captured in MCP for this binding.
	Target SnapshotSubjectRef `json:"target"`

	// Artifact references the cluster-scoped durable data artifact (for example VolumeSnapshotContent).
	Artifact SnapshotDataArtifactRef `json:"artifact"`

	// VolumeMode records the source volume mode (Block or Filesystem).
	VolumeMode string `json:"volumeMode,omitempty"`

	// FsType records the source filesystem type (Filesystem volumes only).
	FsType string `json:"fsType,omitempty"`

	// AccessModes records the source PVC access modes (e.g. ReadWriteOnce, ReadWriteMany).
	AccessModes []string `json:"accessModes,omitempty"`

	// StorageClassName records the source StorageClass of the captured volume.
	StorageClassName string `json:"storageClassName,omitempty"`

	// Size records the real allocated size of the captured volume (e.g. "10Gi"),
	// taken from the data artifact (VolumeSnapshotContent.status.restoreSize).
	Size string `json:"size,omitempty"`
}

SnapshotDataBinding associates the single PVC target of a logical snapshot node with its captured data artifact. Variant A (cardinality ≤1): a SnapshotContent carries at most ONE dataRef; multiple volumes are modeled as child volume nodes (each its own SnapshotContent), never as a list on one node. Field names and types mirror state-snapshotter/api/storage/v1alpha1/snapshotcontent_types.go:97-137.

type SnapshotList

type SnapshotList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Snapshot `json:"items"`
}

SnapshotList is a list of Snapshot objects.

func (*SnapshotList) DeepCopyObject

func (s *SnapshotList) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

type SnapshotMode

type SnapshotMode string

SnapshotMode selects a snapshot's lifecycle. An absent mode is treated as Capture (the server default), so consumers MUST distinguish "unset" from an unknown non-empty value.

const (
	// SnapshotModeCapture is the default: the snapshot captures live cluster state.
	SnapshotModeCapture SnapshotMode = "Capture"
	// SnapshotModeImport marks a snapshot the CLI reconstructs from a downloaded archive.
	SnapshotModeImport SnapshotMode = "Import"
)

type SnapshotSpec

type SnapshotSpec struct {
	// Mode selects Capture (default when empty) or Import. It replaces the removed
	// snapshotClassName field, which is not part of the unified contract.
	Mode SnapshotMode `json:"mode,omitempty"`
}

SnapshotSpec describes the desired snapshot configuration.

type SnapshotStatus

type SnapshotStatus struct {
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// BoundSnapshotContentName is the cluster-scoped name of the bound SnapshotContent.
	BoundSnapshotContentName string `json:"boundSnapshotContentName,omitempty"`

	// ChildrenSnapshotRefs lists child snapshot objects in the run tree.
	// Child namespace is implicit (always equals the parent Snapshot namespace).
	ChildrenSnapshotRefs []SnapshotChildRef `json:"childrenSnapshotRefs,omitempty"`

	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SnapshotStatus carries the latest observations for a Snapshot.

type SnapshotSubjectRef

type SnapshotSubjectRef struct {
	APIVersion string    `json:"apiVersion"`
	Kind       string    `json:"kind"`
	Name       string    `json:"name"`
	Namespace  string    `json:"namespace,omitempty"`
	UID        types.UID `json:"uid,omitempty"`
}

SnapshotSubjectRef identifies the subject (PVC or similar) captured by a data binding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL