v1alpha1

package
v0.0.0-...-e1524c0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the storage v1alpha1 API group +kubebuilder:object:generate=true +groupName=storage.metalk8s.scality.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "storage.metalk8s.scality.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ConditionReason

type ConditionReason string
const (
	ReasonPending     ConditionReason = "Pending"
	ReasonTerminating ConditionReason = "Terminating"

	ReasonInternalError    ConditionReason = "InternalError"
	ReasonCreationError    ConditionReason = "CreationError"
	ReasonDestructionError ConditionReason = "DestructionError"
	ReasonUnavailableError ConditionReason = "UnavailableError"
)

TODO: replace those by more fine-grained ones. "Enum" representing the error codes of the Failed state.

type LVMLVSource

type LVMLVSource struct {
	// Name of the LVM VolumeGroup on the node to create the LVM LogicalVolume to back
	// the PersistentVolume
	VGName string `json:"vgName"`
	// Size of the created LVM LogicalVolume backing the PersistentVolume
	Size resource.Quantity `json:"size"`
}

func (*LVMLVSource) DeepCopy

func (in *LVMLVSource) DeepCopy() *LVMLVSource

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

func (*LVMLVSource) DeepCopyInto

func (in *LVMLVSource) DeepCopyInto(out *LVMLVSource)

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

type PersistentVolumeTemplateSpec

type PersistentVolumeTemplateSpec struct {
	// Standard object's metadata.
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	Metadata metav1.ObjectMeta `json:"metadata,omitempty"`
	// Specification of the Persistent Volume.
	// +optional
	Spec corev1.PersistentVolumeSpec `json:"spec,omitempty"`
}

Describes the PersistentVolume that will be created to back the Volume.

func (*PersistentVolumeTemplateSpec) DeepCopy

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

func (*PersistentVolumeTemplateSpec) DeepCopyInto

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

type RawBlockDeviceVolumeSource

type RawBlockDeviceVolumeSource struct {
	// Path of the block device on the node to back the PersistentVolume.
	DevicePath string `json:"devicePath"`
}

func (*RawBlockDeviceVolumeSource) DeepCopy

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

func (*RawBlockDeviceVolumeSource) DeepCopyInto

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

type SparseLoopDeviceVolumeSource

type SparseLoopDeviceVolumeSource struct {
	// Size of the generated sparse file backing the PersistentVolume.
	Size resource.Quantity `json:"size"`
}

func (*SparseLoopDeviceVolumeSource) DeepCopy

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

func (*SparseLoopDeviceVolumeSource) DeepCopyInto

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

type Volume

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

	Spec   VolumeSpec   `json:"spec,omitempty"`
	Status VolumeStatus `json:"status,omitempty"`
}

Volume is the Schema for the volumes API

func (*Volume) ComputePhase

func (self *Volume) ComputePhase() VolumePhase

Return the volume phase, computed from the Ready condition.

func (*Volume) DeepCopy

func (in *Volume) DeepCopy() *Volume

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

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

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

func (*Volume) DeepCopyObject

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

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

func (*Volume) GetCondition

func (self *Volume) GetCondition(kind VolumeConditionType) *VolumeCondition

Get the condition identified by `kind` for the volume.

Return `nil` if no such condition exists on the volume.

func (*Volume) IsFormatted

func (self *Volume) IsFormatted() bool

func (*Volume) IsInUnrecoverableFailedState

func (self *Volume) IsInUnrecoverableFailedState() *VolumeCondition

Check if a volume is in an unrecoverable state.

func (*Volume) IsValid

func (self *Volume) IsValid() error

Check if a volume is valid.

func (*Volume) SetAvailableStatus

func (self *Volume) SetAvailableStatus()

Update the volume status to Available phase.

func (*Volume) SetCondition

func (self *Volume) SetCondition(
	kind VolumeConditionType,
	status corev1.ConditionStatus,
	reason ConditionReason,
	message string,
)

Set a condition for the volume.

If a condition of this type already exists it is updated, otherwise a new condition is added.

Arguments

kind:      type of condition
status:    status of the condition
reason:    one-word, CamelCase reason for the transition (optional)
message:   details about the transition (optional)

func (*Volume) SetFailedStatus

func (self *Volume) SetFailedStatus(
	reason ConditionReason, format string, args ...interface{},
)

Update the volume status to Failed phase.

Arguments

reason:    the error code that triggered failure.
format:    the string format for the error message
args:      values used in the error message

func (*Volume) SetPendingStatus

func (self *Volume) SetPendingStatus(job string)

Update the volume status to Pending phase.

Arguments

job: job in progress

func (*Volume) SetTerminatingStatus

func (self *Volume) SetTerminatingStatus(job string)

Update the volume status to Terminating phase.

Arguments

job: job in progress

type VolumeCondition

type VolumeCondition struct {
	// Type of volume condition.
	// +kubebuilder:validation:Enum=Ready
	Type VolumeConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status corev1.ConditionStatus `json:"status"`
	// Last time the condition was updated (optional).
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transited from one status to another (optional).
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Unique, one-word, CamelCase reason for the condition's last transition.
	// +kubebuilder:validation:Enum=Pending;Terminating;InternalError;CreationError;DestructionError;UnavailableError
	Reason ConditionReason `json:"reason,omitempty"`
	// Human readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
}

func (*VolumeCondition) DeepCopy

func (in *VolumeCondition) DeepCopy() *VolumeCondition

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

func (*VolumeCondition) DeepCopyInto

func (in *VolumeCondition) DeepCopyInto(out *VolumeCondition)

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

type VolumeConditionType

type VolumeConditionType string
const (
	// VolumeReady means Volume is ready to be used.
	VolumeReady VolumeConditionType = "Ready"
)

type VolumeList

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

VolumeList contains a list of Volume

func (*VolumeList) DeepCopy

func (in *VolumeList) DeepCopy() *VolumeList

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

func (*VolumeList) DeepCopyInto

func (in *VolumeList) DeepCopyInto(out *VolumeList)

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

func (*VolumeList) DeepCopyObject

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

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

type VolumePhase

type VolumePhase string
const (
	VolumeFailed      VolumePhase = "Failed"
	VolumePending     VolumePhase = "Pending"
	VolumeAvailable   VolumePhase = "Available"
	VolumeTerminating VolumePhase = "Terminating"
)

TODO: kept for temporary compatibility, to be removed. "Enum" representing the phase of a volume.

type VolumeSource

type VolumeSource struct {
	SparseLoopDevice *SparseLoopDeviceVolumeSource `json:"sparseLoopDevice,omitempty"`
	RawBlockDevice   *RawBlockDeviceVolumeSource   `json:"rawBlockDevice,omitempty"`
	LVMLogicalVolume *LVMLVSource                  `json:"lvmLogicalVolume,omitempty"`
}

func (*VolumeSource) DeepCopy

func (in *VolumeSource) DeepCopy() *VolumeSource

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

func (*VolumeSource) DeepCopyInto

func (in *VolumeSource) DeepCopyInto(out *VolumeSource)

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

type VolumeSpec

type VolumeSpec struct {

	// Name of the node on which the volume is available.
	NodeName types.NodeName `json:"nodeName"`

	// Name of the StorageClass that gets assigned to the volume. Also, any
	// mount options are copied from the StorageClass to the
	// PersistentVolume if present.
	StorageClassName string `json:"storageClassName"`

	// How the volume is intended to be consumed, either Block or Filesystem
	// (default is Filesystem).
	// +optional
	// +kubebuilder:validation:Enum=Filesystem;Block
	Mode corev1.PersistentVolumeMode `json:"mode,omitempty"`

	// Template for the underlying PersistentVolume.
	// +optional
	Template PersistentVolumeTemplateSpec `json:"template,omitempty"`

	VolumeSource `json:",inline"`
}

VolumeSpec defines the desired state of Volume

func (*VolumeSpec) DeepCopy

func (in *VolumeSpec) DeepCopy() *VolumeSpec

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

func (*VolumeSpec) DeepCopyInto

func (in *VolumeSpec) DeepCopyInto(out *VolumeSpec)

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

type VolumeStatus

type VolumeStatus struct {

	// List of conditions through which the Volume has or has not passed.
	// +listType=map
	// +listMapKey=type
	Conditions []VolumeCondition `json:"conditions,omitempty"`

	// Job in progress
	Job string `json:"job,omitempty"`
	// Name of the underlying block device.
	DeviceName string `json:"deviceName,omitempty"`
}

VolumeStatus defines the observed state of Volume

func (*VolumeStatus) DeepCopy

func (in *VolumeStatus) DeepCopy() *VolumeStatus

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

func (*VolumeStatus) DeepCopyInto

func (in *VolumeStatus) DeepCopyInto(out *VolumeStatus)

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