controller

package
v0.0.0-...-dab620f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeReplicationNameAnnotation = "replication.storage.openshift.io/volume-replication-name"
)

Variables

This section is empty.

Functions

func RunController

func RunController(masterURL, kubeconfig string,
	gk schema.GroupKind, gvr schema.GroupVersionResource)

Types

type Destination

type Destination struct {
	VolumeHandle string            `json:"destination"`
	Context      map[string]string `json:"context"`
}

type ReplicationState

type ReplicationState string

ReplicationState represents the replication operations to be performed on the volume. +kubebuilder:validation:Enum=primary;secondary;resync

const (
	// Primary ReplicationState enables mirroring and promotes the volume to primary.
	Primary ReplicationState = "primary"

	// Secondary ReplicationState demotes the volume to secondary and resyncs the volume if out of sync.
	Secondary ReplicationState = "secondary"

	// Resync option resyncs the volume.
	Resync ReplicationState = "resync"
)

type State

type State string

State captures the latest state of the replication operation.

const (
	// PrimaryState represents the Primary replication state.
	PrimaryState State = "Primary"

	// SecondaryState represents the Secondary replication state.
	SecondaryState State = "Secondary"

	// UnknownState represents the Unknown replication state.
	UnknownState State = "Unknown"
)

type VolumeReplication

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

	// +kubebuilder:validation:Required
	Spec VolumeReplicationSpec `json:"spec"`

	Status VolumeReplicationStatus `json:"status,omitempty"`
}

VolumeReplication is the Schema for the volumereplications API.

type VolumeReplicationList

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

VolumeReplicationList contains a list of VolumeReplication.

type VolumeReplicationSpec

type VolumeReplicationSpec struct {
	// VolumeReplicationClass is the VolumeReplicationClass name for this VolumeReplication resource
	// +kubebuilder:validation:Required
	VolumeReplicationClass string `json:"volumeReplicationClass"`

	// ReplicationState represents the replication operation to be performed on the volume.
	// Supported operations are "primary", "secondary" and "resync"
	// +kubebuilder:validation:Required
	ReplicationState ReplicationState `json:"replicationState"`

	// DataSource represents the object associated with the volume
	// +kubebuilder:validation:Required
	DataSource corev1.TypedLocalObjectReference `json:"dataSource"`

	DataDestination Destination `json:"dataDestination"`

	// AutoResync represents the volume to be auto resynced when
	// ReplicationState is "secondary"
	AutoResync bool `json:"autoResync"`

	// replicationHandle represents an existing (but new) replication id
	// +kubebuilder:validation:Optional
	ReplicationHandle string `json:"replicationHandle"`
}

VolumeReplicationSpec defines the desired state of VolumeReplication.

type VolumeReplicationStatus

type VolumeReplicationStatus struct {
	State   State  `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
	// Conditions are the list of conditions and their status.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// observedGeneration is the last generation change the operator has dealt with
	// +optional
	ObservedGeneration int64        `json:"observedGeneration,omitempty"`
	LastStartTime      *metav1.Time `json:"lastStartTime,omitempty"`
	LastCompletionTime *metav1.Time `json:"lastCompletionTime,omitempty"`
	LastSyncTime       *metav1.Time `json:"lastSyncTime,omitempty"`
}

VolumeReplicationStatus defines the observed state of VolumeReplication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳