v1alpha1

package
v0.33.15 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIGroup is the group storage-foundation serves DataImport under. It is the default this
	// package registers, not the only group these types are ever addressed through: a cluster
	// running storage-volume-data-manager instead serves the same kind under
	// dataapi.LegacyGroup, and callers reach it with AddToSchemeFor.
	APIGroup   = dataapi.FoundationGroup
	APIVersion = dataapi.Version
)
View Source
const PersistentVolumeClaimKind = "PersistentVolumeClaim"

PersistentVolumeClaimKind is the only DataImport destination kind either producer accepts.

Variables

View Source
var (
	SchemeGroupVersion = dataapi.FoundationGroupVersion
	SchemeBuilder      = runtime.NewSchemeBuilder(AddKnownTypes)
	AddToScheme        = SchemeBuilder.AddToScheme
)

SchemeGroupVersion is group version used to register these objects

Functions

func AddKnownTypes

func AddKnownTypes(scheme *runtime.Scheme) error

AddKnownTypes registers the DataImport types under SchemeGroupVersion (storage-foundation). Callers that resolved the served group at runtime use AddToSchemeFor instead.

func AddToSchemeFor added in v0.33.14

func AddToSchemeFor(gv schema.GroupVersion) func(*runtime.Scheme) error

AddToSchemeFor returns a scheme builder that registers the DataImport types under gv.

One Go type serves both producers: the spec carries both destination shapes and fills the one the resolved backend understands (see DataImportSpec). Registering one scheme per resolved group keeps exactly one GroupVersionKind mapped to each type, which is what the controller-runtime client requires to address the object at all.

Types

type DataExportImportStatus

type DataExportImportStatus struct {
	URL                 string             `json:"url"`
	CA                  string             `json:"ca,omitempty"`
	PublicURL           string             `json:"publicURL"`
	AccessTimestamp     metav1.Time        `json:"accessTimestamp"`
	Conditions          []metav1.Condition `json:"conditions,omitempty"`
	VolumeMode          string             `json:"volumeMode,omitempty"`
	DataImportCompleted bool               `json:"dataImportCompleted,omitempty"`
}

func (*DataExportImportStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataExportImportStatus.

func (*DataExportImportStatus) DeepCopyInto

func (in *DataExportImportStatus) DeepCopyInto(out *DataExportImportStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DataImport

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

	Spec   DataImportSpec         `json:"spec"`
	Status DataExportImportStatus `json:"status"`
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*DataImport) DeepCopy

func (in *DataImport) DeepCopy() *DataImport

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataImport.

func (*DataImport) DeepCopyInto

func (in *DataImport) DeepCopyInto(out *DataImport)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DataImport) DeepCopyObject

func (in *DataImport) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*DataImport) GetStatus

func (di *DataImport) GetStatus() *DataExportImportStatus

type DataImportList

type DataImportList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []DataImport `json:"items"`
}

+k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*DataImportList) DeepCopy

func (in *DataImportList) DeepCopy() *DataImportList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataImportList.

func (*DataImportList) DeepCopyInto

func (in *DataImportList) DeepCopyInto(out *DataImportList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DataImportList) DeepCopyObject

func (in *DataImportList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DataImportMode added in v0.32.5

type DataImportMode string

DataImportMode is spec.mode — the explicit discriminator that selects what a DataImport does with the imported bytes. storage-foundation introduced it in place of the polymorphic targetRef.kind discrimination its predecessor used, and its schema has no spec.targetRef at all. Left empty when addressing storage-volume-data-manager, which is the other way round. See storage-foundation/api/v1alpha1/data_import.go for the SSOT.

const DataImportModeCreatePVC DataImportMode = "CreatePVC"

DataImportModeCreatePVC is the standalone PVC-import mode: data bytes are streamed straight into a preserved PVC built from spec.pvcTemplate, with no snapshot capture and no VolumeSnapshotContent artifact. `d8 data import` only ever creates CreatePVC DataImports; the snapshot-leaf mode (PopulateData) is driven by `d8 snapshot upload`, which builds its own unstructured spec.

type DataImportSpec

type DataImportSpec struct {
	TTL     string `json:"ttl"`
	Publish bool   `json:"publish,omitempty"`

	// WaitForFirstConsumer must not carry omitempty, unlike the other bool in this spec: the CRD
	// defaults this field to true, so an absent key means true on the server. omitempty drops
	// the zero value, which for a bool is exactly the false the caller asked for — making
	// `--wffc=false` (and hence the flag's own default) impossible to express.
	WaitForFirstConsumer bool `json:"waitForFirstConsumer"`

	// Mode is the storage-foundation discriminator. Left empty for the older producer, whose
	// schema has no such property.
	Mode DataImportMode `json:"mode,omitempty"`

	// PvcTemplate fully describes the destination PVC for storage-foundation. Its metadata.name
	// is mandatory — the controller names the imported PVC after it and the server CEL rejects
	// an empty name.
	PvcTemplate *PersistentVolumeClaimTemplateSpec `json:"pvcTemplate,omitempty"`

	// TargetRef is the storage-volume-data-manager destination, which nests the same template
	// under a required targetRef. Left nil for storage-foundation, whose schema prunes it.
	TargetRef *DataImportTargetRefSpec `json:"targetRef,omitempty"`
}

DataImportSpec mirrors the PVC-creating subset of the DataImport CRD spec that the CLI produces, in both shapes that subset has been given.

The two producers disagree on how the destination is expressed, and unlike DataExport the disagreement is structural rather than an extra field:

  • storage-foundation discriminates on Mode and reads PvcTemplate from the spec root. Its CEL rules require pvcTemplate and forbid snapshotRef/storageParams when mode == CreatePVC, so those PopulateData-only fields are deliberately absent from this struct.
  • storage-volume-data-manager has no mode at all and requires TargetRef, carrying the same template one level down.

Exactly one of the two shapes is filled per request, chosen from the resolved backend; the other stays nil and is omitted from the wire. Filling both would survive today only because each CRD prunes what it does not declare, and would start writing a field with different meaning the moment either producer grows the other's key. +k8s:deepcopy-gen=true

func (*DataImportSpec) DeepCopy

func (in *DataImportSpec) DeepCopy() *DataImportSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataImportSpec.

func (*DataImportSpec) DeepCopyInto

func (in *DataImportSpec) DeepCopyInto(out *DataImportSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DataImportSpec) DestinationTemplate added in v0.33.14

func (s *DataImportSpec) DestinationTemplate() *PersistentVolumeClaimTemplateSpec

DestinationTemplate returns the destination PVC template whichever shape carries it, so readers of an object fetched from the cluster do not have to know which producer wrote it. Returns nil when neither shape is filled.

type DataImportTargetRefSpec

type DataImportTargetRefSpec struct {
	// Kind is the destination kind; PersistentVolumeClaimKind is the only accepted value.
	Kind string `json:"kind"`

	// PvcTemplate fully describes the destination PVC, exactly as the storage-foundation shape
	// spells it one level up.
	PvcTemplate *PersistentVolumeClaimTemplateSpec `json:"pvcTemplate,omitempty"`
}

DataImportTargetRefSpec is the storage-volume-data-manager shape of the import destination. Its Kind enum admits PersistentVolumeClaim only, which is also the only destination `d8 data import` creates. +k8s:deepcopy-gen=true

func (*DataImportTargetRefSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataImportTargetRefSpec.

func (*DataImportTargetRefSpec) DeepCopyInto

func (in *DataImportTargetRefSpec) DeepCopyInto(out *DataImportTargetRefSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PersistentVolumeAccessMode

type PersistentVolumeAccessMode string

+enum

const (
	// can be mounted in read/write mode to exactly 1 host
	ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce"
	// can be mounted in read-only mode to many hosts
	ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany"
	// can be mounted in read/write mode to many hosts
	ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany"
	// can be mounted in read/write mode to exactly 1 pod
	// cannot be used in combination with other access modes
	ReadWriteOncePod PersistentVolumeAccessMode = "ReadWriteOncePod"
)

type PersistentVolumeClaimSpec

type PersistentVolumeClaimSpec struct {
	AccessModes      []PersistentVolumeAccessMode `json:"accessModes,omitempty"`
	Resources        VolumeResourceRequirements   `json:"resources,omitempty"`
	StorageClassName *string                      `json:"storageClassName,omitempty"`
	VolumeMode       *PersistentVolumeMode        `json:"volumeMode,omitempty"`
}

+k8s:deepcopy-gen=true

func (*PersistentVolumeClaimSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeClaimSpec.

func (*PersistentVolumeClaimSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PersistentVolumeClaimTemplateSpec

type PersistentVolumeClaimTemplateSpec struct {
	metav1.ObjectMeta         `json:"metadata,omitempty"`
	PersistentVolumeClaimSpec `json:"spec,omitempty"`
}

+k8s:deepcopy-gen=true

func (*PersistentVolumeClaimTemplateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeClaimTemplateSpec.

func (*PersistentVolumeClaimTemplateSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PersistentVolumeMode

type PersistentVolumeMode string

PersistentVolumeMode describes how a volume is intended to be consumed, either Block or Filesystem. +enum

const (
	// PersistentVolumeBlock means the volume will not be formatted with a filesystem and will remain a raw block device.
	PersistentVolumeBlock PersistentVolumeMode = "Block"
	// PersistentVolumeFilesystem means the volume will be or is formatted with a filesystem.
	PersistentVolumeFilesystem PersistentVolumeMode = "Filesystem"
)

type ResourceList

type ResourceList map[ResourceName]resource.Quantity

ResourceList is a set of (resource name, quantity) pairs.

type ResourceName

type ResourceName string

+enum

const (
	// Volume size, in bytes (e.g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
	ResourceStorage ResourceName = "storage"
)

type VolumeResourceRequirements

type VolumeResourceRequirements struct {
	Requests ResourceList `json:"requests,omitempty"`
}

VolumeResourceRequirements describes the storage resource requirements for a volume. +k8s:deepcopy-gen=true

func (*VolumeResourceRequirements) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeResourceRequirements.

func (*VolumeResourceRequirements) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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