v1alpha1

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the operations v1alpha1 API group +kubebuilder:object:generate=true +groupName=operations.kubeblocks.io

Index

Constants

View Source
const (
	// condition types
	ConditionTypeCancelled          = "Cancelled"
	ConditionTypeWaitForProgressing = "WaitForProgressing"
	ConditionTypeValidated          = "Validated"
	ConditionTypeSucceed            = "Succeed"
	ConditionTypeFailed             = "Failed"
	ConditionTypeAborted            = "Aborted"
	ConditionTypeRestarting         = "Restarting"
	ConditionTypeVerticalScaling    = "VerticalScaling"
	ConditionTypeHorizontalScaling  = "HorizontalScaling"
	ConditionTypeVolumeExpanding    = "VolumeExpanding"
	ConditionTypeReconfigure        = "Reconfigure"
	ConditionTypeSwitchover         = "Switchover"
	ConditionTypeStop               = "Stopping"
	ConditionTypeStart              = "Starting"
	ConditionTypeVersionUpgrading   = "VersionUpgrading"
	ConditionTypeExpose             = "Exposing"
	ConditionTypeBackup             = "Backup"
	ConditionTypeInstanceRebuilding = "InstancesRebuilding"
	ConditionTypeCustomOperation    = "CustomOperation"

	// condition and event reasons
	ReasonClusterPhaseMismatch  = "ClusterPhaseMismatch"
	ReasonOpsTypeNotSupported   = "OpsTypeNotSupported"
	ReasonValidateFailed        = "ValidateFailed"
	ReasonClusterNotFound       = "ClusterNotFound"
	ReasonOpsRequestFailed      = "OpsRequestFailed"
	ReasonOpsCanceling          = "Canceling"
	ReasonOpsCancelFailed       = "CancelFailed"
	ReasonOpsCancelSucceed      = "CancelSucceed"
	ReasonOpsCancelByController = "CancelByController"
)
View Source
const (
	KBSwitchoverCandidateInstanceForAnyPod = "*"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "operations.kubeblocks.io", 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
)
View Source
var (

	// OpsRequestBehaviourMapper records the opsRequest behaviour according to the OpsType.
	OpsRequestBehaviourMapper = map[OpsType]OpsRequestBehaviour{}
)

log is for logging in this package.

View Source
var SchemeGroupVersion = GroupVersion

SchemeGroupVersion is group version used to register these objects.

Functions

func NewAbortedCondition

func NewAbortedCondition(message string) *metav1.Condition

NewAbortedCondition creates a condition for aborted phase.

func NewBackupCondition

func NewBackupCondition(ops *OpsRequest) *metav1.Condition

NewBackupCondition creates a condition that the OpsRequest backup the cluster.

func NewCancelFailedCondition

func NewCancelFailedCondition(ops *OpsRequest, err error) *metav1.Condition

NewCancelFailedCondition creates a condition for canceling failed.

func NewCancelSucceedCondition

func NewCancelSucceedCondition(opsName string) *metav1.Condition

NewCancelSucceedCondition creates a condition for canceling successfully.

func NewCancelingCondition

func NewCancelingCondition(ops *OpsRequest) *metav1.Condition

NewCancelingCondition the controller is canceling the OpsRequest

func NewExposingCondition

func NewExposingCondition(ops *OpsRequest) *metav1.Condition

func NewFailedCondition

func NewFailedCondition(ops *OpsRequest, err error) *metav1.Condition

NewFailedCondition creates a condition that the OpsRequest processing failed

func NewHorizontalScalingCondition

func NewHorizontalScalingCondition(ops *OpsRequest) *metav1.Condition

NewHorizontalScalingCondition creates a condition that the OpsRequest starts to horizontal scale cluster

func NewInstancesRebuildingCondition

func NewInstancesRebuildingCondition(ops *OpsRequest) *metav1.Condition

NewInstancesRebuildingCondition creates a condition that the operation starts to rebuild the instances.

func NewReconfigureCondition

func NewReconfigureCondition(ops *OpsRequest) *metav1.Condition

NewReconfigureCondition creates a condition that the OpsRequest updating component configuration

func NewReconfigureFailedCondition

func NewReconfigureFailedCondition(ops *OpsRequest, err error) *metav1.Condition

NewReconfigureFailedCondition creates a condition for the failed reconfigure.

func NewReconfigureRunningCondition

func NewReconfigureRunningCondition(ops *OpsRequest, conditionType string, configSpecName string, info ...string) *metav1.Condition

NewReconfigureRunningCondition creates a condition that the OpsRequest reconfigure workflow

func NewRestartingCondition

func NewRestartingCondition(ops *OpsRequest) *metav1.Condition

NewRestartingCondition creates a condition that the operation starts to restart components

func NewRestoreCondition

func NewRestoreCondition(ops *OpsRequest) *metav1.Condition

NewRestoreCondition creates a condition that the OpsRequest restore the cluster.

func NewStartCondition

func NewStartCondition(ops *OpsRequest) *metav1.Condition

NewStartCondition creates a condition that the OpsRequest starts the cluster.

func NewStopCondition

func NewStopCondition(ops *OpsRequest) *metav1.Condition

NewStopCondition creates a condition that the OpsRequest starts to stop the cluster.

func NewSucceedCondition

func NewSucceedCondition(ops *OpsRequest) *metav1.Condition

NewSucceedCondition creates a condition that the controller has successfully processed the OpsRequest

func NewSwitchoveringCondition

func NewSwitchoveringCondition(generation int64, message string) *metav1.Condition

NewSwitchoveringCondition creates a condition that the operation starts to switchover components

func NewUpgradingCondition

func NewUpgradingCondition(ops *OpsRequest) *metav1.Condition

NewUpgradingCondition creates a condition that the OpsRequest starts to upgrade the version

func NewValidateFailedCondition

func NewValidateFailedCondition(reason, message string) *metav1.Condition

NewValidateFailedCondition creates a condition for operation validation failure.

func NewValidatePassedCondition

func NewValidatePassedCondition(opsRequestName string) *metav1.Condition

NewValidatePassedCondition creates a condition for operation validation to pass.

func NewVerticalScalingCondition

func NewVerticalScalingCondition(ops *OpsRequest) *metav1.Condition

NewVerticalScalingCondition creates a condition that the OpsRequest starts to vertical scale cluster

func NewVolumeExpandingCondition

func NewVolumeExpandingCondition(ops *OpsRequest) *metav1.Condition

NewVolumeExpandingCondition creates a condition that the OpsRequest starts to expand volume

func NewWaitForProcessingCondition

func NewWaitForProcessingCondition(ops *OpsRequest) *metav1.Condition

NewWaitForProcessingCondition waits the controller to process the opsRequest.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ActionTask

type ActionTask struct {
	// Represents the name of the task.
	// +kubebuilder:validation:Required
	ObjectKey string `json:"objectKey"`

	// Represents the namespace where the task is deployed.
	// +kubebuilder:validation:Required
	Namespace string `json:"namespace"`

	// Indicates the current status of the task, including "Processing", "Failed", "Succeed".
	// +kubebuilder:validation:Required
	Status ActionTaskStatus `json:"status"`

	// The name of the Pod that the task is associated with or operates on.
	// +optional
	TargetPodName string `json:"targetPodName,omitempty"`

	// The count of retry attempts made for this task.
	// +optional
	Retries int32 `json:"retries,omitempty"`
}

func (*ActionTask) DeepCopy

func (in *ActionTask) DeepCopy() *ActionTask

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

func (*ActionTask) DeepCopyInto

func (in *ActionTask) DeepCopyInto(out *ActionTask)

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

type ActionTaskStatus

type ActionTaskStatus string

ActionTaskStatus defines the status of the task. +enum +kubebuilder:validation:Enum={Processing,Failed,Succeed}

const (
	ProcessingActionTaskStatus ActionTaskStatus = "Processing"
	FailedActionTaskStatus     ActionTaskStatus = "Failed"
	SucceedActionTaskStatus    ActionTaskStatus = "Succeed"
)

type Backup

type Backup struct {
	// Specifies the name of the Backup custom resource.
	//
	// +optional
	BackupName string `json:"backupName,omitempty"`

	// Indicates the name of the BackupPolicy applied to perform this Backup.
	//
	// +optional
	BackupPolicyName string `json:"backupPolicyName,omitempty"`

	// Specifies the name of BackupMethod.
	// The specified BackupMethod must be defined in the BackupPolicy.
	//
	// +optional
	BackupMethod string `json:"backupMethod,omitempty"`

	// Determines whether the backup contents stored in backup repository
	// should be deleted when the Backup custom resource is deleted.
	// Supported values are `Retain` and `Delete`.
	// - `Retain` means that the backup content and its physical snapshot on backup repository are kept.
	// - `Delete` means that the backup content and its physical snapshot on backup repository are deleted.
	// +kubebuilder:validation:Enum=Delete;Retain
	// +kubebuilder:default=Delete
	// +optional
	DeletionPolicy string `json:"deletionPolicy,omitempty"`

	// Determines the duration for which the Backup custom resources should be retained.
	//
	// The controller will automatically remove all Backup objects that are older than the specified RetentionPeriod.
	// For example, RetentionPeriod of `30d` will keep only the Backup objects of last 30 days.
	// Sample duration format:
	//
	// - years: 2y
	// - months: 6mo
	// - days: 30d
	// - hours: 12h
	// - minutes: 30m
	//
	// You can also combine the above durations. For example: 30d12h30m.
	// If not set, the Backup objects will be kept forever.
	//
	// If the `deletionPolicy` is set to 'Delete', then the associated backup data will also be deleted
	// along with the Backup object.
	// Otherwise, only the Backup custom resource will be deleted.
	//
	// +optional
	RetentionPeriod string `json:"retentionPeriod,omitempty"`

	// If the specified BackupMethod is incremental, `parentBackupName` is required.
	//
	// +optional
	ParentBackupName string `json:"parentBackupName,omitempty"`
}

func (*Backup) DeepCopy

func (in *Backup) DeepCopy() *Backup

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

func (*Backup) DeepCopyInto

func (in *Backup) DeepCopyInto(out *Backup)

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

type BackupRefSpec

type BackupRefSpec struct {
	// Refers to a reference backup that needs to be restored.
	// +optional
	Ref RefNamespaceName `json:"ref,omitempty"`
}

func (*BackupRefSpec) DeepCopy

func (in *BackupRefSpec) DeepCopy() *BackupRefSpec

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

func (*BackupRefSpec) DeepCopyInto

func (in *BackupRefSpec) DeepCopyInto(out *BackupRefSpec)

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

type CompletionProbe

type CompletionProbe struct {
	// Specifies the number of seconds to wait after the resource has been patched before initiating completion probes.
	// The default value is 5 seconds, with a minimum value of 1.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=5
	// +optional
	InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`

	// Specifies the number of seconds after which the probe times out.
	// The default value is 60 seconds, with a minimum value of 1.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=60
	// +optional
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`

	// Specifies the frequency (in seconds) at which the probe should be performed.
	// The default value is 5 seconds, with a minimum value of 1.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=5
	// +optional
	PeriodSeconds int32 `json:"periodSeconds,omitempty"`

	// Executes expressions regularly, based on the value of PeriodSeconds, to determine if the action has been completed.
	// +kubebuilder:validation:Required
	MatchExpressions MatchExpressions `json:"matchExpressions"`
}

func (*CompletionProbe) DeepCopy

func (in *CompletionProbe) DeepCopy() *CompletionProbe

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

func (*CompletionProbe) DeepCopyInto

func (in *CompletionProbe) DeepCopyInto(out *CompletionProbe)

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

type ComponentInfo

type ComponentInfo struct {
	// Specifies the name of the ComponentDefinition.
	// The name can represent an exact name, a name prefix, or a regular expression pattern.
	//
	// For example:
	//
	// - "mysql-8.0.30-v1alpha1": Matches the exact name "mysql-8.0.30-v1alpha1"
	// - "mysql-8.0.30": Matches all names starting with "mysql-8.0.30"
	// - "^mysql-8.0.\d{1,2}$": Matches all names starting with "mysql-8.0." followed by one or two digits.
	//
	// +kubebuilder:validation:MaxLength=32
	// +kubebuilder:validation:Required
	ComponentDefinitionName string `json:"componentDefinitionName"`

	// Specifies the account name associated with the Component.
	// If set, the corresponding account username and password are injected into containers' environment variables
	// `KB_ACCOUNT_USERNAME` and `KB_ACCOUNT_PASSWORD`.
	//
	// +optional
	AccountName string `json:"accountName,omitempty"`

	// Specifies the name of the Service.
	// If set, the service name is injected as the `KB_COMP_SVC_NAME` environment variable in the containers,
	// and each service port is mapped to a corresponding environment variable named `KB_COMP_SVC_PORT_$(portName)`.
	// The `portName` is transformed by replacing '-' with '_' and converting to uppercase.
	//
	// +optional
	ServiceName string `json:"serviceName,omitempty"`
}

func (*ComponentInfo) DeepCopy

func (in *ComponentInfo) DeepCopy() *ComponentInfo

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

func (*ComponentInfo) DeepCopyInto

func (in *ComponentInfo) DeepCopyInto(out *ComponentInfo)

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

type ComponentOps

type ComponentOps struct {
	// Specifies the name of the Component.
	// +kubebuilder:validation:Required
	ComponentName string `json:"componentName"`
}

ComponentOps specifies the Component to be operated on.

func (*ComponentOps) DeepCopy

func (in *ComponentOps) DeepCopy() *ComponentOps

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

func (*ComponentOps) DeepCopyInto

func (in *ComponentOps) DeepCopyInto(out *ComponentOps)

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

func (ComponentOps) GetComponentName

func (c ComponentOps) GetComponentName() string

type ConfigurationItem

type ConfigurationItem struct {
	// Specifies the name of the configuration template.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	Name string `json:"name"`

	// Defines the upgrade policy for the configuration.
	//
	// +optional
	Policy *appsv1alpha1.UpgradePolicy `json:"policy,omitempty"`

	// Sets the configuration files and their associated parameters that need to be updated.
	// It should contain at least one item.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +patchMergeKey=key
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=key
	Keys []ParameterConfig `json:"keys" patchStrategy:"merge,retainKeys" patchMergeKey:"key"`
}

func (*ConfigurationItem) DeepCopy

func (in *ConfigurationItem) DeepCopy() *ConfigurationItem

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

func (*ConfigurationItem) DeepCopyInto

func (in *ConfigurationItem) DeepCopyInto(out *ConfigurationItem)

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

type ConfigurationItemStatus

type ConfigurationItemStatus struct {
	// Indicates the name of the configuration template (as ConfigMap).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	Name string `json:"name"`

	// Records the UpgradePolicy of the configuration change operation.
	// +optional
	UpdatePolicy appsv1alpha1.UpgradePolicy `json:"updatePolicy,omitempty"`

	// Represents the current state of the reconfiguration state machine.
	// Possible values include "Creating", "Init", "Running", "Pending", "Merged", "MergeFailed", "FailedAndPause",
	// "Upgrading", "Deleting", "FailedAndRetry", "Finished", "ReconfigurePersisting", "ReconfigurePersisted".
	// +optional
	Status string `json:"status,omitempty"`

	// Provides details about the operation.
	// +optional
	Message string `json:"message,omitempty"`

	// Records the number of pods successfully updated following a configuration change.
	// +kubebuilder:default=0
	// +optional
	SucceedCount int32 `json:"succeedCount"`

	// Represents the total count of pods intended to be updated by a configuration change.
	// +kubebuilder:default=-1
	// +optional
	ExpectedCount int32 `json:"expectedCount"`

	// Records the last state of the reconfiguration finite state machine.
	// Possible values include "None", "Retry", "Failed", "NotSupport", "FailedAndRetry".
	//
	// - "None" describes fsm has finished and quit.
	// - "Retry" describes fsm is running.
	// - "Failed" describes fsm is failed and exited.
	// - "NotSupport" describes fsm does not support the feature.
	// - "FailedAndRetry" describes fsm is failed in current state, but can be retried.
	// +optional
	LastAppliedStatus string `json:"lastStatus,omitempty"`

	// Stores the last applied configuration.
	// +optional
	LastAppliedConfiguration map[string]string `json:"lastAppliedConfiguration,omitempty"`

	// Contains the updated parameters.
	// +optional
	UpdatedParameters UpdatedParameters `json:"updatedParameters"`
}

func (*ConfigurationItemStatus) DeepCopy

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

func (*ConfigurationItemStatus) DeepCopyInto

func (in *ConfigurationItemStatus) DeepCopyInto(out *ConfigurationItemStatus)

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

type CustomOps

type CustomOps struct {
	// Specifies the name of the OpsDefinition.
	//
	// +kubebuilder:validation:Required
	OpsDefinitionName string `json:"opsDefinitionName"`

	// Specifies the name of the ServiceAccount to be used for executing the custom operation.
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`

	// Specifies the maximum number of components to be operated on concurrently to mitigate performance impact
	// on clusters with multiple components.
	//
	// It accepts an absolute number (e.g., 5) or a percentage of components to execute in parallel (e.g., "10%").
	// Percentages are rounded up to the nearest whole number of components.
	// For example, if "10%" results in less than one, it rounds up to 1.
	//
	// When unspecified, all components are processed simultaneously by default.
	//
	// Note: This feature is not implemented yet.
	//
	// +optional
	MaxConcurrentComponents intstr.IntOrString `json:"maxConcurrentComponents,omitempty"`

	// Specifies the components and their parameters for executing custom actions as defined in OpsDefinition.
	// Requires at least one component.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=1024
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	CustomOpsComponents []CustomOpsComponent `json:"components"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`
}

func (*CustomOps) DeepCopy

func (in *CustomOps) DeepCopy() *CustomOps

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

func (*CustomOps) DeepCopyInto

func (in *CustomOps) DeepCopyInto(out *CustomOps)

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

type CustomOpsComponent

type CustomOpsComponent struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies the parameters that match the schema specified in the `opsDefinition.spec.parametersSchema`.
	//
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +optional
	Parameters []Parameter `json:"parameters,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

func (*CustomOpsComponent) DeepCopy

func (in *CustomOpsComponent) DeepCopy() *CustomOpsComponent

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

func (*CustomOpsComponent) DeepCopyInto

func (in *CustomOpsComponent) DeepCopyInto(out *CustomOpsComponent)

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

type EnvVarRef

type EnvVarRef struct {
	// Specifies the container name in the target Pod.
	// If not specified, the first container will be used by default.
	//
	// +optional
	TargetContainerName string `json:"targetContainerName,omitempty"`

	// Defines the name of the environment variable.
	// This name can originate from an 'env' entry or be a data key from an 'envFrom' source.
	//
	// +kubebuilder:validation:Required
	EnvName string `json:"envName"`
}

func (*EnvVarRef) DeepCopy

func (in *EnvVarRef) DeepCopy() *EnvVarRef

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

func (*EnvVarRef) DeepCopyInto

func (in *EnvVarRef) DeepCopyInto(out *EnvVarRef)

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

type Expose

type Expose struct {
	// Specifies the name of the Component.
	ComponentName string `json:"componentName,omitempty"`

	// Indicates whether the services will be exposed.
	// 'Enable' exposes the services. while 'Disable' removes the exposed Service.
	//
	// +kubebuilder:validation:Required
	Switch ExposeSwitch `json:"switch"`

	// Specifies a list of OpsService.
	// When an OpsService is exposed, a corresponding ClusterService will be added to `cluster.spec.services`.
	// On the other hand, when an OpsService is unexposed, the corresponding ClusterService will be removed
	// from `cluster.spec.services`.
	//
	// Note: If `componentName` is not specified, the `ports` and `selector` fields must be provided
	// in each OpsService definition.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minitems=0
	Services []OpsService `json:"services"`
}

func (*Expose) DeepCopy

func (in *Expose) DeepCopy() *Expose

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

func (*Expose) DeepCopyInto

func (in *Expose) DeepCopyInto(out *Expose)

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

type ExposeSwitch

type ExposeSwitch string

ExposeSwitch Specifies the switch for the expose operation. This switch can be used to enable or disable the expose operation. +enum +kubebuilder:validation:Enum={Enable, Disable}

const (
	EnableExposeSwitch  ExposeSwitch = "Enable"
	DisableExposeSwitch ExposeSwitch = "Disable"
)

type FailurePolicyType

type FailurePolicyType string

FailurePolicyType specifies the type of failure policy.

+enum +kubebuilder:validation:Enum={Ignore,Fail}

const (
	// FailurePolicyIgnore means that an error will be ignored but logged.
	FailurePolicyIgnore FailurePolicyType = "Ignore"
	// FailurePolicyFail means that an error will be reported.
	FailurePolicyFail FailurePolicyType = "Fail"
)

type HorizontalScaling

type HorizontalScaling struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies the replica changes for scaling out components and instance templates,
	// and brings offline instances back online. Can be used in conjunction with the "scaleIn" operation.
	// Note: Any configuration that deletes instances is considered invalid.
	//
	// +optional
	ScaleOut *ScaleOut `json:"scaleOut,omitempty"`

	// Specifies the replica changes for scaling in components and instance templates,
	// and takes specified instances offline. Can be used in conjunction with the "scaleOut" operation.
	// Note: Any configuration that creates instances is considered invalid.
	// +optional
	ScaleIn *ScaleIn `json:"scaleIn,omitempty"`
}

HorizontalScaling defines the parameters of a horizontal scaling operation.

func (*HorizontalScaling) DeepCopy

func (in *HorizontalScaling) DeepCopy() *HorizontalScaling

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

func (*HorizontalScaling) DeepCopyInto

func (in *HorizontalScaling) DeepCopyInto(out *HorizontalScaling)

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

type Instance

type Instance struct {
	// Pod name of the instance.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// The instance will rebuild on the specified node.
	// If not set, it will rebuild on a random node.
	// +optional
	TargetNodeName string `json:"targetNodeName,omitempty"`
}

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

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

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

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

type InstanceReplicasTemplate

type InstanceReplicasTemplate struct {
	// Specifies the name of the instance template.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Specifies the replica changes for the instance template.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Required
	ReplicaChanges int32 `json:"replicaChanges"`
}

InstanceReplicasTemplate defines the template for instance replicas.

func (*InstanceReplicasTemplate) DeepCopy

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

func (*InstanceReplicasTemplate) DeepCopyInto

func (in *InstanceReplicasTemplate) DeepCopyInto(out *InstanceReplicasTemplate)

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

type InstanceResourceTemplate

type InstanceResourceTemplate struct {
	// Refer to the instance template name of the component or sharding.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Defines the computational resource size for vertical scaling.
	// +kubebuilder:pruning:PreserveUnknownFields
	corev1.ResourceRequirements `json:",inline"`
}

func (*InstanceResourceTemplate) DeepCopy

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

func (*InstanceResourceTemplate) DeepCopyInto

func (in *InstanceResourceTemplate) DeepCopyInto(out *InstanceResourceTemplate)

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

type InstanceVolumeClaimTemplate

type InstanceVolumeClaimTemplate struct {
	// Refer to the instance template name of the component or sharding.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// volumeClaimTemplates specifies the storage size and volumeClaimTemplate name.
	// +kubebuilder:validation:Required
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	VolumeClaimTemplates []OpsRequestVolumeClaimTemplate `json:"volumeClaimTemplates" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

func (*InstanceVolumeClaimTemplate) DeepCopy

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

func (*InstanceVolumeClaimTemplate) DeepCopyInto

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

type JSONPatchOperation

type JSONPatchOperation struct {
	// Specifies the type of JSON patch operation. It supports the following values: 'add', 'remove', 'replace'.
	// +enum
	// +kubebuilder:validation:Enum={add,remove,replace}
	// +kubebuilder:validation:Required
	Operation string `json:"op"`

	// Specifies the json patch path.
	// +kubebuilder:validation:Required
	Path string `json:"path"`

	// Specifies the value to be used in the JSON patch operation.
	// +kubebuilder:validation:Required
	Value string `json:"value"`
}

func (*JSONPatchOperation) DeepCopy

func (in *JSONPatchOperation) DeepCopy() *JSONPatchOperation

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

func (*JSONPatchOperation) DeepCopyInto

func (in *JSONPatchOperation) DeepCopyInto(out *JSONPatchOperation)

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

type LastComponentConfiguration

type LastComponentConfiguration struct {
	// Records the `replicas` of the Component prior to any changes.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// Records the resources of the Component prior to any changes.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	corev1.ResourceRequirements `json:",inline,omitempty"`

	// Records volumes' storage size of the Component prior to any changes.
	// +optional
	VolumeClaimTemplates []OpsRequestVolumeClaimTemplate `json:"volumeClaimTemplates,omitempty"`

	// Records the ClusterComponentService list of the Component prior to any changes.
	// +optional
	Services []appsv1.ClusterComponentService `json:"services,omitempty"`

	// Records the InstanceTemplate list of the Component prior to any changes.
	// +optional
	Instances []appsv1.InstanceTemplate `json:"instances,omitempty"`

	// Records the offline instances of the Component prior to any changes.
	// +optional
	OfflineInstances []string `json:"offlineInstances,omitempty"`

	// Records the version of the Service expected to be provisioned by this Component prior to any changes.
	// +optional
	ServiceVersion string `json:"serviceVersion,omitempty"`

	// Records the name of the ComponentDefinition prior to any changes.
	// +optional
	ComponentDefinitionName string `json:"componentDefinitionName,omitempty"`
}

LastComponentConfiguration can be used to track and compare the desired state of the Component over time.

func (*LastComponentConfiguration) DeepCopy

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

func (*LastComponentConfiguration) DeepCopyInto

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

type LastConfiguration

type LastConfiguration struct {

	// Records the configuration of each Component prior to any changes.
	// +optional
	Components map[string]LastComponentConfiguration `json:"components,omitempty"`
}

func (*LastConfiguration) DeepCopy

func (in *LastConfiguration) DeepCopy() *LastConfiguration

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

func (*LastConfiguration) DeepCopyInto

func (in *LastConfiguration) DeepCopyInto(out *LastConfiguration)

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

type MatchExpressions

type MatchExpressions struct {
	// Specifies a failure condition for an action using a Go template expression.
	// Should evaluate to either `true` or `false`.
	// The current resource object is parsed into the Go template.
	// for example, you can use '{{ eq .spec.replicas 1 }}'.
	// +optional
	Failure string `json:"failure,omitempty"`

	// Specifies a success condition for an action using a Go template expression.
	// Should evaluate to either `true` or `false`.
	// The current resource object is parsed into the Go template.
	// for example, using '{{ eq .spec.replicas 1 }}'
	// +kubebuilder:validation:Required
	Success string `json:"success"`
}

func (*MatchExpressions) DeepCopy

func (in *MatchExpressions) DeepCopy() *MatchExpressions

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

func (*MatchExpressions) DeepCopyInto

func (in *MatchExpressions) DeepCopyInto(out *MatchExpressions)

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

type OpsAction

type OpsAction struct {
	// Specifies the name of the OpsAction.
	// +kubebuilder:validation:MaxLength=20
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Specifies the failure policy of the OpsAction.
	// Valid values are:
	//
	// - "Fail": Marks the entire OpsRequest as failed if the action fails.
	// - "Ignore": The OpsRequest continues processing despite the failure of the action.
	// +kubebuilder:validation:Enum={Ignore,Fail}
	// +kubebuilder:default=Fail
	// +optional
	FailurePolicy FailurePolicyType `json:"failurePolicy"`

	// Specifies the parameters for the OpsAction. Their usage varies based on the action type:
	//
	// - For 'workload' or 'exec' actions, parameters are injected as environment variables.
	// - For 'resourceModifier' actions, parameter can be referenced using $() in fields
	// `resourceModifier.completionProbe.matchExpressions` and `resourceModifier.jsonPatches[*].value`.
	//
	// +optional
	Parameters []string `json:"parameters,omitempty"`

	// Specifies the configuration for a 'workload' action.
	// This action leads to the creation of a K8s workload, such as a Pod or Job, to execute specified tasks.
	//
	// +optional
	Workload *OpsWorkloadAction `json:"workload,omitempty"`

	// Specifies the configuration for a 'exec' action.
	// It creates a Pod and invokes a 'kubectl exec' to run command inside a specified container with the target Pod.
	// +optional
	Exec *OpsExecAction `json:"exec,omitempty"`

	// Specifies the configuration for a 'resourceModifier' action.
	// This action allows for modifications to existing K8s objects.
	//
	// Note: This feature has not been implemented yet.
	//
	// +optional
	ResourceModifier *OpsResourceModifierAction `json:"resourceModifier,omitempty"`
}

OpsAction specifies a custom action defined in OpsDefinition for execution in a "Custom" OpsRequest.

OpsAction can be of three types:

  • workload: Creates a Job or Pod to run custom scripts, ideal for isolated or long-running tasks.
  • exec: Executes commands directly within an existing container using the kubectl exec interface, suitable for immediate, short-lived operations.
  • resourceModifier: Modifies a K8s object using JSON patches, useful for updating the spec of some resource.

+kubebuilder:validation:XValidation:rule="has(self.workload) || has(self.exec) || has(self.resourceModifier)", message="at least one action exists for workload, exec and resourceModifier."

func (*OpsAction) DeepCopy

func (in *OpsAction) DeepCopy() *OpsAction

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

func (*OpsAction) DeepCopyInto

func (in *OpsAction) DeepCopyInto(out *OpsAction)

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

type OpsDefinition

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

	Spec   OpsDefinitionSpec   `json:"spec,omitempty"`
	Status OpsDefinitionStatus `json:"status,omitempty"`
}

OpsDefinition is the Schema for the OpsDefinitions API.

func (*OpsDefinition) DeepCopy

func (in *OpsDefinition) DeepCopy() *OpsDefinition

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

func (*OpsDefinition) DeepCopyInto

func (in *OpsDefinition) DeepCopyInto(out *OpsDefinition)

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

func (*OpsDefinition) DeepCopyObject

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

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

func (*OpsDefinition) GetComponentInfo

func (o *OpsDefinition) GetComponentInfo(compDefName string) *ComponentInfo

type OpsDefinitionList

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

OpsDefinitionList contains a list of OpsDefinition.

func (*OpsDefinitionList) DeepCopy

func (in *OpsDefinitionList) DeepCopy() *OpsDefinitionList

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

func (*OpsDefinitionList) DeepCopyInto

func (in *OpsDefinitionList) DeepCopyInto(out *OpsDefinitionList)

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

func (*OpsDefinitionList) DeepCopyObject

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

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

type OpsDefinitionSpec

type OpsDefinitionSpec struct {
	// Specifies the preconditions that must be met to run the actions for the operation.
	// if set, it will check the condition before the Component runs this operation.
	// Example:
	// “`yaml
	//  preConditions:
	//  - rule:
	//      expression: '{{ eq .component.status.phase "Running" }}'
	//      message: Component is not in Running status.
	// “`
	// +optional
	PreConditions []PreCondition `json:"preConditions,omitempty"`

	// Specifies a list of PodInfoExtractor, each designed to select a specific Pod and extract selected runtime info
	// from its PodSpec.
	// The extracted information, such as environment variables, volumes and tolerations, are then injected into
	// Jobs or Pods that execute the OpsActions defined in `actions`.
	//
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +optional
	PodInfoExtractors []PodInfoExtractor `json:"podInfoExtractors,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`

	// Specifies a list of ComponentDefinition for Components associated with this OpsDefinition.
	// It also includes connection credentials (address and account) for each Component.
	//
	// +patchMergeKey=componentDefinitionName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentDefinitionName
	// +optional
	ComponentInfos []ComponentInfo `json:"componentInfos,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"componentDefinitionName"`

	// Specifies the schema for validating the data types and value ranges of parameters in OpsActions before their usage.
	//
	// +optional
	ParametersSchema *ParametersSchema `json:"parametersSchema,omitempty"`

	// Specifies a list of OpsAction where each customized action is executed sequentially.
	//
	// +kubebuilder:validation:MinItems=1
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:Required
	Actions []OpsAction `json:"actions" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

OpsDefinitionSpec defines the desired state of OpsDefinition.

func (*OpsDefinitionSpec) DeepCopy

func (in *OpsDefinitionSpec) DeepCopy() *OpsDefinitionSpec

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

func (*OpsDefinitionSpec) DeepCopyInto

func (in *OpsDefinitionSpec) DeepCopyInto(out *OpsDefinitionSpec)

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

type OpsDefinitionStatus

type OpsDefinitionStatus struct {
	// Represents the most recent generation observed of this OpsDefinition.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Represents the current state of the OpsDefinition.
	// Valid values are "", "Available", "Unavailable".
	// When it equals to "Available", the OpsDefinition is ready and can be used in a "Custom" OpsRequest.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Provides additional information about the current phase.
	// +optional
	Message string `json:"message,omitempty"`
}

OpsDefinitionStatus defines the observed state of OpsDefinition

func (*OpsDefinitionStatus) DeepCopy

func (in *OpsDefinitionStatus) DeepCopy() *OpsDefinitionStatus

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

func (*OpsDefinitionStatus) DeepCopyInto

func (in *OpsDefinitionStatus) DeepCopyInto(out *OpsDefinitionStatus)

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

type OpsEnvVar

type OpsEnvVar struct {
	// Specifies the name of the environment variable to be injected into Pods executing OpsActions.
	// It must conform to the C_IDENTIFIER format, which includes only alphanumeric characters and underscores, and cannot begin with a digit.
	//
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Specifies the source of the environment variable's value.
	//
	// +kubebuilder:validation:Required
	ValueFrom *OpsVarSource `json:"valueFrom"`
}

func (*OpsEnvVar) DeepCopy

func (in *OpsEnvVar) DeepCopy() *OpsEnvVar

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

func (*OpsEnvVar) DeepCopyInto

func (in *OpsEnvVar) DeepCopyInto(out *OpsEnvVar)

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

type OpsExecAction

type OpsExecAction struct {
	// Specifies a PodInfoExtractor defined in the `opsDefinition.spec.podInfoExtractors`.
	// +kubebuilder:validation:Required
	PodInfoExtractorName string `json:"podInfoExtractorName"`

	// Specifies the number of retries allowed before marking the action as failed.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:default=0
	// +optional
	BackoffLimit int32 `json:"backoffLimit,omitempty"`

	// The command to be executed via 'kubectl exec --'.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:Required
	Command []string `json:"command"`

	// The name of the container in the target pod where the command should be executed.
	// This corresponds to the `-c {containerName}` option in `kubectl exec`.
	//
	// If not set, the first container is used.
	//
	// +optional
	ContainerName string `json:"containerName"`
}

func (*OpsExecAction) DeepCopy

func (in *OpsExecAction) DeepCopy() *OpsExecAction

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

func (*OpsExecAction) DeepCopyInto

func (in *OpsExecAction) DeepCopyInto(out *OpsExecAction)

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

type OpsPhase

type OpsPhase string

OpsPhase defines opsRequest phase. +enum +kubebuilder:validation:Enum={Pending,Creating,Running,Cancelling,Cancelled,Aborted,Failed,Succeed}

const (
	OpsPendingPhase    OpsPhase = "Pending"
	OpsCreatingPhase   OpsPhase = "Creating"
	OpsRunningPhase    OpsPhase = "Running"
	OpsCancellingPhase OpsPhase = "Cancelling"
	OpsSucceedPhase    OpsPhase = "Succeed"
	OpsCancelledPhase  OpsPhase = "Cancelled"
	OpsFailedPhase     OpsPhase = "Failed"
	OpsAbortedPhase    OpsPhase = "Aborted"
)

type OpsRecorder

type OpsRecorder struct {
	// name OpsRequest name
	Name string `json:"name"`
	// opsRequest type
	Type OpsType `json:"type"`
	// indicates whether the current opsRequest is in the queue
	InQueue bool `json:"inQueue,omitempty"`
	// indicates that the operation is queued for execution within its own-type scope.
	QueueBySelf bool `json:"queueBySelf,omitempty"`
}

func (*OpsRecorder) DeepCopy

func (in *OpsRecorder) DeepCopy() *OpsRecorder

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

func (*OpsRecorder) DeepCopyInto

func (in *OpsRecorder) DeepCopyInto(out *OpsRecorder)

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

type OpsRequest

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

	Spec   OpsRequestSpec   `json:"spec,omitempty"`
	Status OpsRequestStatus `json:"status,omitempty"`
}

OpsRequest is the Schema for the opsrequests API

func GetRunningOpsByOpsType

func GetRunningOpsByOpsType(ctx context.Context, cli client.Client,
	clusterName, namespace, opsType string) ([]OpsRequest, error)

GetRunningOpsByOpsType gets the running opsRequests by type.

func (*OpsRequest) CountOfflineOrOnlineInstances

func (r *OpsRequest) CountOfflineOrOnlineInstances(clusterName, componentName string, hScaleInstanceNames []string) map[string]int32

CountOfflineOrOnlineInstances calculate the number of instances that need to be brought online and offline corresponding to the instance template name.

func (*OpsRequest) DeepCopy

func (in *OpsRequest) DeepCopy() *OpsRequest

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

func (*OpsRequest) DeepCopyInto

func (in *OpsRequest) DeepCopyInto(out *OpsRequest)

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

func (*OpsRequest) DeepCopyObject

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

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

func (*OpsRequest) Force

func (r *OpsRequest) Force() bool

Force checks if the current opsRequest can be forcibly executed

func (*OpsRequest) IsComplete

func (r *OpsRequest) IsComplete(phases ...OpsPhase) bool

IsComplete checks if opsRequest has been completed.

func (*OpsRequest) SetStatusCondition

func (r *OpsRequest) SetStatusCondition(condition metav1.Condition)

func (*OpsRequest) Validate

func (r *OpsRequest) Validate(ctx context.Context,
	k8sClient client.Client,
	cluster *appsv1.Cluster,
	needCheckClusterPhase bool) error

Validate validates OpsRequest

func (*OpsRequest) ValidateClusterPhase

func (r *OpsRequest) ValidateClusterPhase(cluster *appsv1.Cluster) error

ValidateClusterPhase validates whether the current cluster state supports the OpsRequest

func (*OpsRequest) ValidateOps

func (r *OpsRequest) ValidateOps(ctx context.Context,
	k8sClient client.Client,
	cluster *appsv1.Cluster) error

ValidateOps validates ops attributes

type OpsRequestBehaviour

type OpsRequestBehaviour struct {
	FromClusterPhases []appsv1.ClusterPhase
	ToClusterPhase    appsv1.ClusterPhase
}

func (*OpsRequestBehaviour) DeepCopy

func (in *OpsRequestBehaviour) DeepCopy() *OpsRequestBehaviour

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

func (*OpsRequestBehaviour) DeepCopyInto

func (in *OpsRequestBehaviour) DeepCopyInto(out *OpsRequestBehaviour)

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

type OpsRequestComponentStatus

type OpsRequestComponentStatus struct {
	// Records the current phase of the Component, mirroring `cluster.status.components[componentName].phase`.
	// +optional
	Phase appsv1.ComponentPhase `json:"phase,omitempty"`

	// Records the timestamp when the Component last transitioned to a "Failed" phase.
	// +optional
	LastFailedTime metav1.Time `json:"lastFailedTime,omitempty"`

	// Records the result of the preConditions check of the opsRequest, which determines subsequent steps.
	// +optional
	PreCheckResult *PreCheckResult `json:"preCheck,omitempty"`

	// Describes the progress details of objects or actions associated with the Component.
	// +optional
	ProgressDetails []ProgressStatusDetail `json:"progressDetails,omitempty"`

	// Provides an explanation for the Component being in its current state.
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`

	// Provides a human-readable message indicating details about this operation.
	// +kubebuilder:validation:MaxLength=32768
	// +optional
	Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}

func (*OpsRequestComponentStatus) DeepCopy

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

func (*OpsRequestComponentStatus) DeepCopyInto

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

type OpsRequestList

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

OpsRequestList contains a list of OpsRequest

func (*OpsRequestList) DeepCopy

func (in *OpsRequestList) DeepCopy() *OpsRequestList

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

func (*OpsRequestList) DeepCopyInto

func (in *OpsRequestList) DeepCopyInto(out *OpsRequestList)

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

func (*OpsRequestList) DeepCopyObject

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

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

type OpsRequestSpec

type OpsRequestSpec struct {
	// Specifies the name of the Cluster resource that this operation is targeting.
	//
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.clusterName"
	ClusterName string `json:"clusterName,omitempty"`

	// Indicates whether the current operation should be canceled and terminated gracefully if it's in the
	// "Pending", "Creating", or "Running" state.
	//
	// This field applies only to "VerticalScaling" and "HorizontalScaling" opsRequests.
	//
	// Note: Setting `cancel` to true is irreversible; further modifications to this field are ineffective.
	//
	// +optional
	Cancel bool `json:"cancel,omitempty"`

	// Instructs the system to bypass pre-checks (including cluster state checks and customized pre-conditions hooks)
	// and immediately execute the opsRequest, except for the opsRequest of 'Start' type, which will still undergo
	// pre-checks even if `force` is true.
	//
	// This is useful for concurrent execution of 'VerticalScaling' and 'HorizontalScaling' opsRequests.
	// By setting `force` to true, you can bypass the default checks and demand these opsRequests to run
	// simultaneously.
	//
	// Note: Once set, the `force` field is immutable and cannot be updated.
	//
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.force"
	// +optional
	Force bool `json:"force,omitempty"`

	// Indicates whether opsRequest should continue to queue when 'force' is set to true.
	// +kubebuilder:default=false
	// +optional
	EnqueueOnForce bool `json:"enqueueOnForce,omitempty"`

	// Specifies the type of this operation. Supported types include "Start", "Stop", "Restart", "Switchover",
	// "VerticalScaling", "HorizontalScaling", "VolumeExpansion", "Reconfiguring", "Upgrade", "Backup", "Restore",
	// "Expose", "RebuildInstance", "Custom".
	//
	// Note: This field is immutable once set.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.type"
	Type OpsType `json:"type"`

	// Specifies the duration in seconds that an OpsRequest will remain in the system after successfully completing
	// (when `opsRequest.status.phase` is "Succeed") before automatic deletion.
	//
	// +optional
	TTLSecondsAfterSucceed int32 `json:"ttlSecondsAfterSucceed,omitempty"`

	// Specifies the duration in seconds that an OpsRequest will remain in the system after completion
	// for any phase other than "Succeed" (e.g., "Failed", "Cancelled", "Aborted") before automatic deletion.
	//
	// +optional
	TTLSecondsAfterUnsuccessfulCompletion int32 `json:"ttlSecondsAfterUnsuccessfulCompletion,omitempty"`

	// Specifies the maximum time in seconds that the OpsRequest will wait for its pre-conditions to be met
	// before it aborts the operation.
	// If set to 0 (default), pre-conditions must be satisfied immediately for the OpsRequest to proceed.
	//
	// +kubebuilder:default=0
	// +optional
	PreConditionDeadlineSeconds *int32 `json:"preConditionDeadlineSeconds,omitempty"`

	// Specifies the maximum duration (in seconds) that an opsRequest is allowed to run.
	// If the opsRequest runs longer than this duration, its phase will be marked as Aborted.
	// If this value is not set or set to 0, the timeout will be ignored and the opsRequest will run indefinitely.
	// +optional
	// +kubebuilder:Minimum=0
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`

	// Exactly one of its members must be set.
	SpecificOpsRequest `json:",inline"`
}

OpsRequestSpec defines the desired state of OpsRequest

+kubebuilder:validation:XValidation:rule="has(self.cancel) && self.cancel ? (self.type in ['VerticalScaling', 'HorizontalScaling']) : true",message="forbidden to cancel the opsRequest which type not in ['VerticalScaling','HorizontalScaling']"

func (*OpsRequestSpec) DeepCopy

func (in *OpsRequestSpec) DeepCopy() *OpsRequestSpec

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

func (*OpsRequestSpec) DeepCopyInto

func (in *OpsRequestSpec) DeepCopyInto(out *OpsRequestSpec)

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

func (OpsRequestSpec) GetBackup

func (r OpsRequestSpec) GetBackup() *Backup

func (OpsRequestSpec) GetClusterName

func (r OpsRequestSpec) GetClusterName() string

func (OpsRequestSpec) GetRestore

func (r OpsRequestSpec) GetRestore() *Restore

func (OpsRequestSpec) ToExposeListToMap

func (r OpsRequestSpec) ToExposeListToMap() map[string]Expose

ToExposeListToMap build expose map

type OpsRequestStatus

type OpsRequestStatus struct {
	// Records the cluster generation after the OpsRequest action has been handled.
	// +optional
	ClusterGeneration int64 `json:"clusterGeneration,omitempty"`

	// Represents the phase of the OpsRequest.
	// Possible values include "Pending", "Creating", "Running", "Cancelling", "Cancelled", "Failed", "Succeed".
	Phase OpsPhase `json:"phase,omitempty"`

	// Represents the progress of the OpsRequest.
	// +kubebuilder:validation:Pattern:=`^(\d+|\-)/(\d+|\-)$`
	// +kubebuilder:default=-/-
	Progress string `json:"progress"`

	// Records the configuration prior to any changes.
	// +optional
	LastConfiguration LastConfiguration `json:"lastConfiguration,omitempty"`

	// Records the status information of Components changed due to the OpsRequest.
	// +optional
	Components map[string]OpsRequestComponentStatus `json:"components,omitempty"`

	// A collection of additional key-value pairs that provide supplementary information for the OpsRequest.
	Extras []map[string]string `json:"extras,omitempty"`

	// Records the time when the OpsRequest started processing.
	// +optional
	StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`

	// Records the time when the OpsRequest was completed.
	// +optional
	CompletionTimestamp metav1.Time `json:"completionTimestamp,omitempty"`

	// Records the time when the OpsRequest was cancelled.
	// +optional
	CancelTimestamp metav1.Time `json:"cancelTimestamp,omitempty"`

	// Records the status of a reconfiguring operation if `opsRequest.spec.type` equals to "Reconfiguring".
	// +optional
	ReconfiguringStatusAsComponent map[string]*ReconfiguringStatus `json:"reconfiguringStatusAsComponent,omitempty"`

	// Describes the detailed status of the OpsRequest.
	// Possible condition types include "Cancelled", "WaitForProgressing", "Validated", "Succeed", "Failed", "Restarting",
	// "VerticalScaling", "HorizontalScaling", "VolumeExpanding", "Reconfigure", "Switchover", "Stopping", "Starting",
	// "VersionUpgrading", "Exposing", "Backup", "InstancesRebuilding", "CustomOperation".
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

OpsRequestStatus represents the observed state of an OpsRequest.

func (*OpsRequestStatus) DeepCopy

func (in *OpsRequestStatus) DeepCopy() *OpsRequestStatus

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

func (*OpsRequestStatus) DeepCopyInto

func (in *OpsRequestStatus) DeepCopyInto(out *OpsRequestStatus)

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

type OpsRequestVolumeClaimTemplate

type OpsRequestVolumeClaimTemplate struct {
	// Specifies the desired storage size for the volume.
	//
	// +kubebuilder:validation:Required
	Storage resource.Quantity `json:"storage"`

	// Specify the name of the volumeClaimTemplate in the Component.
	// The specified name must match one of the volumeClaimTemplates defined
	// in the `clusterComponentSpec.volumeClaimTemplates` field.
	//
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

func (*OpsRequestVolumeClaimTemplate) DeepCopy

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

func (*OpsRequestVolumeClaimTemplate) DeepCopyInto

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

type OpsResourceModifierAction

type OpsResourceModifierAction struct {
	// Specifies the K8s object that is to be updated.
	//
	// +kubebuilder:validation:Required
	Resource TypedObjectRef `json:"resource"`

	// Specifies a list of patches for modifying the object.
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:Required
	JSONPatches []JSONPatchOperation `json:"jsonPatches"`

	// Specifies a method to determine if the action has been completed.
	//
	// Note: This feature has not been implemented yet.
	//
	// +kubebuilder:validation:Required
	CompletionProbe CompletionProbe `json:"completionProbe"`
}

func (*OpsResourceModifierAction) DeepCopy

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

func (*OpsResourceModifierAction) DeepCopyInto

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

type OpsService

type OpsService struct {
	// Specifies the name of the Service. This name is used to set `clusterService.name`.
	//
	// Note: This field cannot be updated.
	//
	// +required
	Name string `json:"name"`

	// Contains cloud provider related parameters if ServiceType is LoadBalancer.
	//
	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer.
	//
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Specifies Port definitions that are to be exposed by a ClusterService.
	//
	// If not specified, the Port definitions from non-NodePort and non-LoadBalancer type ComponentService
	// defined in the ComponentDefinition (`componentDefinition.spec.services`) will be used.
	// If no matching ComponentService is found, the expose operation will fail.
	//
	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
	//
	// +patchMergeKey=port
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=port
	// +listMapKey=protocol
	// +optional
	Ports []corev1.ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"`

	// Specifies a role to target with the service.
	// If specified, the service will only be exposed to pods with the matching role.
	//
	// Note: If the component has roles, at least one of 'roleSelector' or 'podSelector' must be specified.
	// If both are specified, a pod must match both conditions to be selected.
	//
	// +optional
	RoleSelector string `json:"roleSelector,omitempty"`

	// Routes service traffic to pods with matching label keys and values.
	// If specified, the service will only be exposed to pods matching the selector.
	//
	// Note: If the component has roles, at least one of 'roleSelector' or 'podSelector' must be specified.
	// If both are specified, a pod must match both conditions to be selected.
	//
	// +optional
	// +mapType=atomic
	PodSelector map[string]string `json:"podSelector,omitempty"`

	// Determines how the Service is exposed. Defaults to 'ClusterIP'.
	// Valid options are `ClusterIP`, `NodePort`, and `LoadBalancer`.
	//
	// - `ClusterIP`: allocates a cluster-internal IP address for load-balancing to endpoints.
	//    Endpoints are determined by the selector or if that is not specified,
	//    they are determined by manual construction of an Endpoints object or EndpointSlice objects.
	// - `NodePort`: builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP.
	// - `LoadBalancer`: builds on NodePort and creates an external load-balancer (if supported in the current cloud)
	//    which routes to the same endpoints as the clusterIP.
	//
	// Note: although K8s Service type allows the 'ExternalName' type, it is not a valid option for the expose operation.
	//
	// For more info, see:
	// https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types.
	//
	// +optional
	ServiceType corev1.ServiceType `json:"serviceType,omitempty"`

	// A list of IP families (e.g., IPv4, IPv6) assigned to this Service.
	//
	// Usually assigned automatically based on the cluster configuration and the `ipFamilyPolicy` field.
	// If specified manually, the requested IP family must be available in the cluster and allowed by the `ipFamilyPolicy`.
	// If the requested IP family is not available or not allowed, the Service creation will fail.
	//
	// Valid values:
	//
	// - "IPv4"
	// - "IPv6"
	//
	// This field may hold a maximum of two entries (dual-stack families, in either order).
	//
	// Common combinations of `ipFamilies` and `ipFamilyPolicy` are:
	//
	// - ipFamilies=[] + ipFamilyPolicy="PreferDualStack" :
	//   The Service prefers dual-stack but can fall back to single-stack if the cluster does not support dual-stack.
	//   The IP family is automatically assigned based on the cluster configuration.
	// - ipFamilies=["IPV4","IPV6"] + ipFamilyPolicy="RequiredDualStack" :
	//   The Service requires dual-stack and will only be created if the cluster supports both IPv4 and IPv6.
	//   The primary IP family is IPV4.
	// - ipFamilies=["IPV6","IPV4"] + ipFamilyPolicy="RequiredDualStack" :
	//   The Service requires dual-stack and will only be created if the cluster supports both IPv4 and IPv6.
	//   The primary IP family is IPV6.
	// - ipFamilies=["IPV4"] + ipFamilyPolicy="SingleStack" :
	//   The Service uses a single-stack with IPv4 only.
	// - ipFamilies=["IPV6"] + ipFamilyPolicy="SingleStack" :
	//   The Service uses a single-stack with IPv6 only.
	//
	// +listType=atomic
	// +optional
	IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty" protobuf:"bytes,19,opt,name=ipFamilies,casttype=IPFamily"`

	// Specifies whether the Service should use a single IP family (SingleStack) or two IP families (DualStack).
	//
	// Possible values:
	//
	// - 'SingleStack' (default) : The Service uses a single IP family.
	//   If no value is provided, IPFamilyPolicy defaults to SingleStack.
	// - 'PreferDualStack' : The Service prefers to use two IP families on dual-stack configured clusters
	//   or a single IP family on single-stack clusters.
	// - 'RequiredDualStack' : The Service requires two IP families on dual-stack configured clusters.
	//   If the cluster is not configured for dual-stack, the Service creation fails.
	//
	// +optional
	IPFamilyPolicy *corev1.IPFamilyPolicy `json:"ipFamilyPolicy,omitempty" protobuf:"bytes,17,opt,name=ipFamilyPolicy,casttype=IPFamilyPolicy"`
}

OpsService represents the parameters to dynamically create or remove a ClusterService in the `cluster.spec.services` array.

func (*OpsService) DeepCopy

func (in *OpsService) DeepCopy() *OpsService

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

func (*OpsService) DeepCopyInto

func (in *OpsService) DeepCopyInto(out *OpsService)

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

type OpsType

type OpsType string

OpsType defines operation types. +enum +kubebuilder:validation:Enum={Upgrade,VerticalScaling,VolumeExpansion,HorizontalScaling,Restart,Reconfiguring,Start,Stop,Expose,Switchover,Backup,Restore,RebuildInstance,Custom}

const (
	VerticalScalingType   OpsType = "VerticalScaling"
	HorizontalScalingType OpsType = "HorizontalScaling"
	VolumeExpansionType   OpsType = "VolumeExpansion"
	UpgradeType           OpsType = "Upgrade"
	ReconfiguringType     OpsType = "Reconfiguring"
	SwitchoverType        OpsType = "Switchover"
	RestartType           OpsType = "Restart" // RestartType the restart operation is a special case of the rolling update operation.
	StopType              OpsType = "Stop"    // StopType the stop operation will delete all pods in a cluster concurrently.
	StartType             OpsType = "Start"   // StartType the start operation will start the pods which is deleted in stop operation.
	ExposeType            OpsType = "Expose"
	BackupType            OpsType = "Backup"
	RestoreType           OpsType = "Restore"
	RebuildInstanceType   OpsType = "RebuildInstance" // RebuildInstance rebuilding an instance is very useful when a node is offline or an instance is unrecoverable.
	CustomType            OpsType = "Custom"          // use opsDefinition
)

type OpsVarSource

type OpsVarSource struct {
	// Specifies a reference to a specific environment variable within a container.
	// Used to specify the source of the variable, which can be either "env" or "envFrom".
	//
	// +optional
	EnvVarRef *EnvVarRef `json:"envRef,omitempty"`

	// Represents the JSONPath expression pointing to the specific data within the JSON structure of the target Pod.
	// It is used to extract precise data locations for operations on the Pod.
	//
	// +optional
	FieldRef *corev1.ObjectFieldSelector `json:"fieldPath,omitempty"`
}

func (*OpsVarSource) DeepCopy

func (in *OpsVarSource) DeepCopy() *OpsVarSource

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

func (*OpsVarSource) DeepCopyInto

func (in *OpsVarSource) DeepCopyInto(out *OpsVarSource)

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

type OpsWorkloadAction

type OpsWorkloadAction struct {
	// Defines the workload type of the action. Valid values include "Job" and "Pod".
	//
	// - "Job": Creates a Job to execute the action.
	// - "Pod": Creates a Pod to execute the action.
	//    Note: unlike Jobs, manually deleting a Pod does not affect the `backoffLimit`.
	//
	// +kubebuilder:validation:Required
	Type OpsWorkloadType `json:"type"`

	// Specifies a PodInfoExtractor defined in the `opsDefinition.spec.podInfoExtractors`.
	PodInfoExtractorName string `json:"podInfoExtractorName,omitempty"`

	// Specifies the number of retries allowed before marking the action as failed.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:default=0
	// +optional
	BackoffLimit int32 `json:"backoffLimit,omitempty"`

	// Specifies the PodSpec of the 'workload' action.
	// +kubebuilder:validation:Required
	PodSpec corev1.PodSpec `json:"podSpec"`
}

func (*OpsWorkloadAction) DeepCopy

func (in *OpsWorkloadAction) DeepCopy() *OpsWorkloadAction

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

func (*OpsWorkloadAction) DeepCopyInto

func (in *OpsWorkloadAction) DeepCopyInto(out *OpsWorkloadAction)

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

type OpsWorkloadType

type OpsWorkloadType string

OpsWorkloadType policy after action failure. +enum +kubebuilder:validation:Enum={Job,Pod}

const (
	PodWorkload OpsWorkloadType = "Pod"
	JobWorkload OpsWorkloadType = "Job"
)

type Parameter

type Parameter struct {
	// Specifies the identifier of the parameter as defined in the OpsDefinition.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Holds the data associated with the parameter.
	// If the parameter type is an array, the format should be "v1,v2,v3".
	// +kubebuilder:validation:Required
	Value string `json:"value"`

	// Source for the parameter's value. Cannot be used if value is not empty.
	//
	ValueFrom *ParameterSource `json:"valueFrom,omitempty"`
}

func (*Parameter) DeepCopy

func (in *Parameter) DeepCopy() *Parameter

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

func (*Parameter) DeepCopyInto

func (in *Parameter) DeepCopyInto(out *Parameter)

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

type ParameterConfig

type ParameterConfig struct {
	// Represents a key in the configuration template(as ConfigMap).
	// Each key in the ConfigMap corresponds to a specific configuration file.
	//
	// +kubebuilder:validation:Required
	Key string `json:"key"`

	// Specifies a list of key-value pairs representing parameters and their corresponding values
	// within a single configuration file.
	// This field is used to override or set the values of parameters without modifying the entire configuration file.
	//
	// Either the `parameters` field or the `fileContent` field must be set, but not both.
	//
	// +optional
	Parameters []ParameterPair `json:"parameters,omitempty"`

	// Specifies the content of the entire configuration file.
	// This field is used to update the complete configuration file.
	//
	// Either the `parameters` field or the `fileContent` field must be set, but not both.
	//
	// +optional
	FileContent string `json:"fileContent,omitempty"`
}

func (*ParameterConfig) DeepCopy

func (in *ParameterConfig) DeepCopy() *ParameterConfig

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

func (*ParameterConfig) DeepCopyInto

func (in *ParameterConfig) DeepCopyInto(out *ParameterConfig)

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

type ParameterPair

type ParameterPair struct {
	// Represents the name of the parameter that is to be updated.
	// +kubebuilder:validation:Required
	Key string `json:"key"`

	// Represents the parameter values that are to be updated.
	// If set to nil, the parameter defined by the Key field will be removed from the configuration file.
	// +optional
	Value *string `json:"value"`
}

func (*ParameterPair) DeepCopy

func (in *ParameterPair) DeepCopy() *ParameterPair

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

func (*ParameterPair) DeepCopyInto

func (in *ParameterPair) DeepCopyInto(out *ParameterPair)

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

type ParameterSource

type ParameterSource struct {
	// Selects a key of a ConfigMap.
	// +optional
	ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
	// Selects a key of a Secret.
	// +optional
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

func (*ParameterSource) DeepCopy

func (in *ParameterSource) DeepCopy() *ParameterSource

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

func (*ParameterSource) DeepCopyInto

func (in *ParameterSource) DeepCopyInto(out *ParameterSource)

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

type ParametersSchema

type ParametersSchema struct {
	// Defines the schema for parameters using the OpenAPI v3.
	// The supported property types include:
	// - string
	// - number
	// - integer
	// - array: Note that only items of string type are supported.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:Type=object
	// +kubebuilder:pruning:PreserveUnknownFields
	// +k8s:conversion-gen=false
	// +optional
	OpenAPIV3Schema *apiextensionsv1.JSONSchemaProps `json:"openAPIV3Schema,omitempty"`
}

func (*ParametersSchema) DeepCopy

func (in *ParametersSchema) DeepCopy() *ParametersSchema

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

func (*ParametersSchema) DeepCopyInto

func (in *ParametersSchema) DeepCopyInto(out *ParametersSchema)

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

type Phase

type Phase string

Phase represents the current status of the ClusterDefinition CR.

+enum +kubebuilder:validation:Enum={Available,Unavailable}

const (
	// AvailablePhase indicates that the object is in an available state.
	AvailablePhase Phase = "Available"

	// UnavailablePhase indicates that the object is in an unavailable state.
	UnavailablePhase Phase = "Unavailable"
)

type PodInfoExtractor

type PodInfoExtractor struct {
	// Specifies the name of the PodInfoExtractor.
	//
	// +kubebuilder:validation:MaxLength=32
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Specifies a list of environment variables to be extracted from a selected Pod,
	// and injected into the containers executing each OpsAction.
	//
	// +optional
	Env []OpsEnvVar `json:"env,omitempty"`

	// Used to select the target Pod from which environment variables and volumes are extracted from its PodSpec.
	//
	// +kubebuilder:validation:Required
	PodSelector PodSelector `json:"podSelector"`

	// Specifies a list of volumes, along with their respective mount points, that are to be extracted from a selected Pod,
	// and mounted onto the containers executing each OpsAction.
	// This allows the containers to access shared or persistent data necessary for the operation.
	//
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

func (*PodInfoExtractor) DeepCopy

func (in *PodInfoExtractor) DeepCopy() *PodInfoExtractor

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

func (*PodInfoExtractor) DeepCopyInto

func (in *PodInfoExtractor) DeepCopyInto(out *PodInfoExtractor)

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

type PodSelectionPolicy

type PodSelectionPolicy string

PodSelectionPolicy pod selection strategy. +enum +kubebuilder:validation:Enum={All,Any}

const (
	All PodSelectionPolicy = "All"
	Any PodSelectionPolicy = "Any"
)

type PodSelector

type PodSelector struct {
	// Specifies the role of the target Pod.
	//
	// +optional
	Role string `json:"role,omitempty"`

	// Defines the policy for selecting the target pod when multiple pods match the podSelector.
	// It can be either 'Any' (select any one pod that matches the podSelector)
	// or 'All' (select all pods that match the podSelector).
	//
	// +kubebuilder:default=Any
	// +kubebuilder:validation:Required
	MultiPodSelectionPolicy PodSelectionPolicy `json:"multiPodSelectionPolicy,omitempty"`
}

PodSelector selects the target Pod from which environment variables and volumes are extracted from its PodSpec.

func (*PodSelector) DeepCopy

func (in *PodSelector) DeepCopy() *PodSelector

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

func (*PodSelector) DeepCopyInto

func (in *PodSelector) DeepCopyInto(out *PodSelector)

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

type PointInTimeRefSpec

type PointInTimeRefSpec struct {
	// Refers to the specific time point for restoration, with UTC as the time zone.
	// +optional
	Time *metav1.Time `json:"time,omitempty"`

	// Refers to a reference source cluster that needs to be restored.
	// +optional
	Ref RefNamespaceName `json:"ref,omitempty"`
}

func (*PointInTimeRefSpec) DeepCopy

func (in *PointInTimeRefSpec) DeepCopy() *PointInTimeRefSpec

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

func (*PointInTimeRefSpec) DeepCopyInto

func (in *PointInTimeRefSpec) DeepCopyInto(out *PointInTimeRefSpec)

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

type PreCheckResult

type PreCheckResult struct {
	// Indicates whether the preCheck operation passed or failed.
	// +kubebuilder:validation:Required
	Pass bool `json:"pass"`

	// Provides explanations related to the preCheck result in a human-readable format.
	// +optional
	Message string `json:"message,omitempty"`
}

func (*PreCheckResult) DeepCopy

func (in *PreCheckResult) DeepCopy() *PreCheckResult

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

func (*PreCheckResult) DeepCopyInto

func (in *PreCheckResult) DeepCopyInto(out *PreCheckResult)

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

type PreCondition

type PreCondition struct {
	// Specifies the conditions that must be met for the operation to execute.
	Rule *Rule `json:"rule,omitempty"`
}

func (*PreCondition) DeepCopy

func (in *PreCondition) DeepCopy() *PreCondition

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

func (*PreCondition) DeepCopyInto

func (in *PreCondition) DeepCopyInto(out *PreCondition)

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

type ProgressStatus

type ProgressStatus string

ProgressStatus defines the status of the opsRequest progress. +enum +kubebuilder:validation:Enum={Processing,Pending,Failed,Succeed}

const (
	PendingProgressStatus    ProgressStatus = "Pending"
	ProcessingProgressStatus ProgressStatus = "Processing"
	FailedProgressStatus     ProgressStatus = "Failed"
	SucceedProgressStatus    ProgressStatus = "Succeed"
)

type ProgressStatusDetail

type ProgressStatusDetail struct {
	// Specifies the group to which the current object belongs to.
	// +optional
	Group string `json:"group,omitempty"`

	// `objectKey` uniquely identifies the object, which can be any K8s object, like a Pod, Job, Component, or PVC.
	// Either `objectKey` or `actionName` must be provided.
	// +optional
	ObjectKey string `json:"objectKey,omitempty"`

	// Indicates the name of an OpsAction, as defined in `opsDefinition.spec.actions[*].name`.
	// Either `objectKey` or `actionName` must be provided.
	// +optional
	ActionName string `json:"actionName,omitempty"`

	// Lists the tasks, such as Jobs or Pods, that carry out the action.
	// +optional
	ActionTasks []ActionTask `json:"actionTasks,omitempty"`

	// Represents the current processing state of the object, including "Processing", "Pending", "Failed", "Succeed"
	// +kubebuilder:validation:Required
	Status ProgressStatus `json:"status"`

	// Provides a human-readable explanation of the object's condition.
	// +optional
	Message string `json:"message,omitempty"`

	// Records the start time of object processing.
	// +optional
	StartTime metav1.Time `json:"startTime,omitempty"`

	// Records the completion time of object processing.
	// +optional
	EndTime metav1.Time `json:"endTime,omitempty"`
}

func (*ProgressStatusDetail) DeepCopy

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

func (*ProgressStatusDetail) DeepCopyInto

func (in *ProgressStatusDetail) DeepCopyInto(out *ProgressStatusDetail)

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

func (*ProgressStatusDetail) SetStatusAndMessage

func (p *ProgressStatusDetail) SetStatusAndMessage(status ProgressStatus, message string)

type RebuildInstance

type RebuildInstance struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies the instances (Pods) that need to be rebuilt, typically operating as standbys.
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:Required
	Instances []Instance `json:"instances"`

	// When it is set to true, the instance will be rebuilt in-place.
	// By default, a new pod will be created. Once the new pod is ready to serve,
	// the instance that require rebuilding will be taken offline.
	// +kubebuilder:validation:default=false
	InPlace bool `json:"inPlace,omitempty"`

	// Indicates the name of the Backup custom resource from which to recover the instance.
	// Defaults to an empty PersistentVolume if unspecified.
	//
	// Note:
	// - Only full physical backups are supported for multi-replica Components (e.g., 'xtrabackup' for MySQL).
	// - Logical backups (e.g., 'mysqldump' for MySQL) are unsupported in the current version.
	//
	// +optional
	BackupName string `json:"backupName,omitempty"`

	// Defines container environment variables for the restore process.
	// merged with the ones specified in the Backup and ActionSet resources.
	//
	// Merge priority: Restore env > Backup env > ActionSet env.
	//
	// Purpose: Some databases require different configurations when being restored as a standby
	// compared to being restored as a primary.
	// For example, when restoring MySQL as a replica, you need to set `skip_slave_start="ON"` for 5.7
	// or `skip_replica_start="ON"` for 8.0.
	// Allowing environment variables to be passed in makes it more convenient to control these behavioral differences
	// during the restore process.
	//
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	RestoreEnv []corev1.EnvVar `json:"restoreEnv,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

func (*RebuildInstance) DeepCopy

func (in *RebuildInstance) DeepCopy() *RebuildInstance

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

func (*RebuildInstance) DeepCopyInto

func (in *RebuildInstance) DeepCopyInto(out *RebuildInstance)

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

type Reconfigure

type Reconfigure struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Contains a list of ConfigurationItem objects, specifying the Component's configuration template name,
	// upgrade policy, and parameter key-value pairs to be updated.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	Configurations []ConfigurationItem `json:"configurations" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

Reconfigure defines the parameters for updating a Component's configuration.

func (*Reconfigure) DeepCopy

func (in *Reconfigure) DeepCopy() *Reconfigure

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

func (*Reconfigure) DeepCopyInto

func (in *Reconfigure) DeepCopyInto(out *Reconfigure)

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

type ReconfiguringStatus

type ReconfiguringStatus struct {
	// Describes the reconfiguring detail status.
	// Possible condition types include "Creating", "Init", "Running", "Pending", "Merged", "MergeFailed", "FailedAndPause",
	// "Upgrading", "Deleting", "FailedAndRetry", "Finished", "ReconfigurePersisting", "ReconfigurePersisted".
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Describes the status of the component reconfiguring.
	// +kubebuilder:validation:Required
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	ConfigurationStatus []ConfigurationItemStatus `json:"configurationStatus"`
}

func (*ReconfiguringStatus) DeepCopy

func (in *ReconfiguringStatus) DeepCopy() *ReconfiguringStatus

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

func (*ReconfiguringStatus) DeepCopyInto

func (in *ReconfiguringStatus) DeepCopyInto(out *ReconfiguringStatus)

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

type RefNamespaceName

type RefNamespaceName struct {
	// Refers to the specific name of the resource.
	// +optional
	Name string `json:"name,omitempty"`

	// Refers to the specific namespace of the resource.
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

func (*RefNamespaceName) DeepCopy

func (in *RefNamespaceName) DeepCopy() *RefNamespaceName

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

func (*RefNamespaceName) DeepCopyInto

func (in *RefNamespaceName) DeepCopyInto(out *RefNamespaceName)

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

type ReplicaChanger

type ReplicaChanger struct {
	// Specifies the replica changes for the component.
	// +kubebuilder:validation:Minimum=0
	ReplicaChanges *int32 `json:"replicaChanges,omitempty"`

	// Modifies the desired replicas count for existing InstanceTemplate.
	// if the inst
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +optional
	Instances []InstanceReplicasTemplate `json:"instances,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

ReplicaChanger defines the parameters for changing the number of replicas.

func (*ReplicaChanger) DeepCopy

func (in *ReplicaChanger) DeepCopy() *ReplicaChanger

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

func (*ReplicaChanger) DeepCopyInto

func (in *ReplicaChanger) DeepCopyInto(out *ReplicaChanger)

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

type Restore

type Restore struct {
	// Specifies the name of the Backup custom resource.
	//
	// +kubebuilder:validation:Required
	BackupName string `json:"backupName"`

	// Specifies the point in time to which the restore should be performed.
	// Supported time formats:
	//
	// - RFC3339 format, e.g. "2023-11-25T18:52:53Z"
	// - A human-readable date-time format, e.g. "Jul 25,2023 18:52:53 UTC+0800"
	//
	RestorePointInTime string `json:"restorePointInTime,omitempty"`

	// Specifies a list of environment variables to be set in the container.
	//
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// Specifies the policy for restoring volume claims of a Component's Pods.
	// It determines whether the volume claims should be restored sequentially (one by one) or in parallel (all at once).
	// Support values:
	//
	// - "Serial"
	// - "Parallel"
	//
	// +kubebuilder:validation:Enum=Serial;Parallel
	// +kubebuilder:default=Parallel
	VolumeRestorePolicy string `json:"volumeRestorePolicy,omitempty"`

	// Controls the timing of PostReady actions during the recovery process.
	//
	// If false (default), PostReady actions execute when the Component reaches the "Running" state.
	// If true, PostReady actions are delayed until the entire Cluster is "Running,"
	// ensuring the cluster's overall stability before proceeding.
	//
	// This setting is useful for coordinating PostReady operations across the Cluster for optimal cluster conditions.
	DeferPostReadyUntilClusterRunning bool `json:"deferPostReadyUntilClusterRunning,omitempty"`
}

func (*Restore) DeepCopy

func (in *Restore) DeepCopy() *Restore

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

func (*Restore) DeepCopyInto

func (in *Restore) DeepCopyInto(out *Restore)

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

type Rule

type Rule struct {
	// Specifies a Go template expression that determines how the operation can be executed.
	// The return value must be either `true` or `false`.
	// Available built-in objects that can be referenced in the expression include:
	//
	// - `params`: Input parameters.
	// - `cluster`: The referenced Cluster object.
	// - `component`: The referenced Component object.
	//
	// +kubebuilder:validation:Required
	Expression string `json:"expression"`

	// Specifies the error or status message reported if the `expression` does not evaluate to `true`.
	//
	// +kubebuilder:validation:Required
	Message string `json:"message"`
}

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

type ScaleIn

type ScaleIn struct {

	// Modifies the replicas of the component and instance templates.
	ReplicaChanger `json:",inline"`

	// Specifies the instance names that need to be taken offline.
	// +optional
	OnlineInstancesToOffline []string `json:"onlineInstancesToOffline,omitempty"`
}

ScaleIn defines the configuration for a scale-in operation.

func (*ScaleIn) DeepCopy

func (in *ScaleIn) DeepCopy() *ScaleIn

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

func (*ScaleIn) DeepCopyInto

func (in *ScaleIn) DeepCopyInto(out *ScaleIn)

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

type ScaleOut

type ScaleOut struct {

	// Modifies the replicas of the component and instance templates.
	ReplicaChanger `json:",inline"`

	// Defines the configuration for new instances added during scaling, including resource requirements, labels, annotations, etc.
	// New instances are created based on the provided instance templates.
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	NewInstances []appsv1.InstanceTemplate `json:"newInstances,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`

	// Specifies the instances in the offline list to bring back online.
	// +optional
	OfflineInstancesToOnline []string `json:"offlineInstancesToOnline,omitempty"`
}

ScaleOut defines the configuration for a scale-out operation.

func (*ScaleOut) DeepCopy

func (in *ScaleOut) DeepCopy() *ScaleOut

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

func (*ScaleOut) DeepCopyInto

func (in *ScaleOut) DeepCopyInto(out *ScaleOut)

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

type SpecificOpsRequest

type SpecificOpsRequest struct {
	// Specifies the desired new version of the Cluster.
	//
	// Note: This field is immutable once set.
	//
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.upgrade"
	Upgrade *Upgrade `json:"upgrade,omitempty"`

	// Lists HorizontalScaling objects, each specifying scaling requirements for a Component,
	// including desired replica changes, configurations for new instances, modifications for existing instances,
	// and take offline/online the specified instances.
	//
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.horizontalScaling"
	HorizontalScalingList []HorizontalScaling `json:"horizontalScaling,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists VolumeExpansion objects, each specifying a component and its corresponding volumeClaimTemplates
	// that requires storage expansion.
	//
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	VolumeExpansionList []VolumeExpansion `json:"volumeExpansion,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists Components to be restarted.
	//
	// +optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.restart"
	// +kubebuilder:validation:MaxItems=1024
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	RestartList []ComponentOps `json:"restart,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists Switchover objects, each specifying a Component to perform the switchover operation.
	//
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.switchover"
	SwitchoverList []Switchover `json:"switchover,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists VerticalScaling objects, each specifying a component and its desired compute resources for vertical scaling.
	//
	// +kubebuilder:validation:MaxItems=1024
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	VerticalScalingList []VerticalScaling `json:"verticalScaling,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists Reconfigure objects, each specifying a Component and its configuration updates.
	//
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.reconfigure"
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	Reconfigures []Reconfigure `json:"reconfigures,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Lists Expose objects, each specifying a Component and its services to be exposed.
	//
	// +optional
	ExposeList []Expose `json:"expose,omitempty"`

	// Specifies the parameters to back up a Cluster.
	// +optional
	Backup *Backup `json:"backup,omitempty"`

	// Specifies the parameters to restore a Cluster.
	// Note that this restore operation will roll back cluster services.
	//
	// +optional
	Restore *Restore `json:"restore,omitempty"`

	// Specifies the parameters to rebuild some instances.
	// Rebuilding an instance involves restoring its data from a backup or another database replica.
	// The instances being rebuilt usually serve as standby in the cluster.
	// Hence, rebuilding instances is often also referred to as "standby reconstruction".
	//
	// +optional
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.rebuildFrom"
	RebuildFrom []RebuildInstance `json:"rebuildFrom,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`

	// Specifies a custom operation defined by OpsDefinition.
	//
	// +optional
	CustomOps *CustomOps `json:"custom,omitempty"`
}

func (*SpecificOpsRequest) DeepCopy

func (in *SpecificOpsRequest) DeepCopy() *SpecificOpsRequest

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

func (*SpecificOpsRequest) DeepCopyInto

func (in *SpecificOpsRequest) DeepCopyInto(out *SpecificOpsRequest)

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

type Switchover

type Switchover struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies the instance to become the primary or leader during a switchover operation.
	//
	// The value of `instanceName` can be either:
	//
	// 1. "*" (wildcard value):
	// - Indicates no specific instance is designated as the primary or leader.
	//
	// 2. A valid instance name (pod name):
	// - Designates a specific instance (pod) as the primary or leader.
	// - The name must match one of the pods in the component. Any non-valid pod name is considered invalid.
	//
	// +kubebuilder:validation:Required
	InstanceName string `json:"instanceName"`
}

func (*Switchover) DeepCopy

func (in *Switchover) DeepCopy() *Switchover

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

func (*Switchover) DeepCopyInto

func (in *Switchover) DeepCopyInto(out *Switchover)

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

type TypedObjectRef

type TypedObjectRef struct {
	// Specifies the group for the resource being referenced.
	// If not specified, the referenced Kind must belong to the core API group.
	// For all third-party types, this is mandatory.
	// +kubebuilder:validation:Required
	APIGroup *string `json:"apiGroup"`

	// Specifies the type of resource being referenced.
	// +kubebuilder:validation:Required
	Kind string `json:"kind"`

	// Indicates the name of the resource being referenced.
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

func (*TypedObjectRef) DeepCopy

func (in *TypedObjectRef) DeepCopy() *TypedObjectRef

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

func (*TypedObjectRef) DeepCopyInto

func (in *TypedObjectRef) DeepCopyInto(out *TypedObjectRef)

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

type UpdatedParameters

type UpdatedParameters struct {
	// Maps newly added configuration files to their content.
	// +optional
	AddedKeys map[string]string `json:"addedKeys,omitempty"`

	// Lists the name of configuration files that have been deleted.
	// +optional
	DeletedKeys map[string]string `json:"deletedKeys,omitempty"`

	// Maps the name of configuration files to their updated content, detailing the changes made.
	// +optional
	UpdatedKeys map[string]string `json:"updatedKeys,omitempty"`
}

UpdatedParameters holds details about the modifications made to configuration parameters. Example:

```yaml updatedParameters:

updatedKeys:
  my.cnf: '{"mysqld":{"max_connections":"100"}}'

```

func (*UpdatedParameters) DeepCopy

func (in *UpdatedParameters) DeepCopy() *UpdatedParameters

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

func (*UpdatedParameters) DeepCopyInto

func (in *UpdatedParameters) DeepCopyInto(out *UpdatedParameters)

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

type Upgrade

type Upgrade struct {
	// Lists components to be upgrade based on desired ComponentDefinition and ServiceVersion.
	// From the perspective of cluster API, the reasonable combinations should be:
	// 1. (comp-def, service-ver) - upgrade to the specified service version and component definition, the user takes the responsibility to ensure that they are compatible.
	// 2. ("", service-ver) - upgrade to the specified service version, let the operator choose the latest compatible component definition.
	// 3. (comp-def, "") - upgrade to the specified component definition, let the operator choose the latest compatible service version.
	// 4. ("", "") - upgrade to the latest service version and component definition, the operator will ensure the compatibility between the selected versions.
	// +patchMergeKey=componentName
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=componentName
	// +kubebuilder:validation:MaxItems=1024
	// +optional
	Components []UpgradeComponent `json:"components,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"componentName"`
}

Upgrade defines the parameters for an upgrade operation.

func (*Upgrade) DeepCopy

func (in *Upgrade) DeepCopy() *Upgrade

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

func (*Upgrade) DeepCopyInto

func (in *Upgrade) DeepCopyInto(out *Upgrade)

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

type UpgradeComponent

type UpgradeComponent struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies the name of the ComponentDefinition, only exact matches are supported.
	// +kubebuilder:validation:MaxLength=64
	// +optional
	ComponentDefinitionName *string `json:"componentDefinitionName,omitempty"`

	// Specifies the version of the Service expected to be provisioned by this Component.
	// Referring to the ServiceVersion defined by the ComponentDefinition and ComponentVersion.
	// And ServiceVersion in ClusterComponentSpec is optional, when no version is specified,
	// use the latest available version in ComponentVersion.
	// +kubebuilder:validation:MaxLength=32
	// +optional
	ServiceVersion *string `json:"serviceVersion,omitempty"`
}

func (*UpgradeComponent) DeepCopy

func (in *UpgradeComponent) DeepCopy() *UpgradeComponent

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

func (*UpgradeComponent) DeepCopyInto

func (in *UpgradeComponent) DeepCopyInto(out *UpgradeComponent)

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

type VerticalScaling

type VerticalScaling struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Defines the desired compute resources of the Component's instances.
	//
	// +kubebuilder:pruning:PreserveUnknownFields
	corev1.ResourceRequirements `json:",inline"`

	// Specifies the desired compute resources of the instance template that need to vertical scale.
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +optional
	Instances []InstanceResourceTemplate `json:"instances,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

VerticalScaling refers to the process of adjusting compute resources (e.g., CPU, memory) allocated to a Component. It defines the parameters required for the operation.

func (*VerticalScaling) DeepCopy

func (in *VerticalScaling) DeepCopy() *VerticalScaling

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

func (*VerticalScaling) DeepCopyInto

func (in *VerticalScaling) DeepCopyInto(out *VerticalScaling)

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

type VolumeExpansion

type VolumeExpansion struct {
	// Specifies the name of the Component.
	ComponentOps `json:",inline"`

	// Specifies a list of OpsRequestVolumeClaimTemplate objects, defining the volumeClaimTemplates
	// that are used to expand the storage and the desired storage size for each one.
	//
	// +kubebuilder:validation:Required
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	VolumeClaimTemplates []OpsRequestVolumeClaimTemplate `json:"volumeClaimTemplates" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`

	// Specifies the desired storage size of the instance template that need to volume expand.
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +optional
	Instances []InstanceVolumeClaimTemplate `json:"instances,omitempty"  patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

VolumeExpansion encapsulates the parameters required for a volume expansion operation.

func (*VolumeExpansion) DeepCopy

func (in *VolumeExpansion) DeepCopy() *VolumeExpansion

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

func (*VolumeExpansion) DeepCopyInto

func (in *VolumeExpansion) DeepCopyInto(out *VolumeExpansion)

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