v1alpha1

package
v0.8.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	// +optional
	Resource v1.ResourceRequirements `json:"resource,omitempty"`
	// +optional
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	Param IntOrStringMap `json:"param"`
	// +optional
	PersistentVolumeClaimName string `json:"persistentVolumeClaimName"`
	// +optional
	Metrics Metrics `json:"metrics,omitempty"`
}

type BasicContainerTemplate

type BasicContainerTemplate struct {
	Image string `json:"image"`
	// +optional
	Command []string `json:"command,omitempty"`
	// +optional
	Env []v1.EnvVar `json:"env,omitempty"`
}

type CdcConfig

type CdcConfig struct {
	// +optional
	Config BaseConfig `json:"config"`
}

type CdcModel

type CdcModel struct {
	Container BasicContainerTemplate `json:"container"`
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	Param IntOrStringMap `json:"param"`
}

type CliStepEnum

type CliStepEnum string
const (
	CliStepGlobal     CliStepEnum = "global"
	CliStepPreCheck   CliStepEnum = "precheck"
	CliStepInitStruct CliStepEnum = "init-struct"
	CliStepInitData   CliStepEnum = "init-data"
	CliStepCdc        CliStepEnum = "cdc"
)

func (CliStepEnum) String

func (s CliStepEnum) String() string

type ConflictPolicyEnum

type ConflictPolicyEnum string
const (
	Ignore   ConflictPolicyEnum = "ignore"   // default in FullLoad
	Override ConflictPolicyEnum = "override" // default in CDC
)

type DBObjectExpress

type DBObjectExpress struct {
	SchemaName string `json:"schemaName"`
	// +optional
	SchemaMappingName string `json:"schemaMappingName"`
	// +optional
	IsAll bool `json:"isAll"`
	// +optional
	TableList   []TableObjectExpress `json:"tableList"`
	DxlOpConfig `json:""`
}

func (*DBObjectExpress) String

func (d *DBObjectExpress) String() []string

type DBTypeEnum

type DBTypeEnum string

DBTypeEnum defines the MigrationTemplate CR .spec.Source.DbType or .spec.Sink.DbType +enum +kubebuilder:validation:Enum={MySQL, PostgreSQL}

const (
	MigrationDBTypeMySQL      DBTypeEnum = "MySQL" // default value
	MigrationDBTypePostgreSQL DBTypeEnum = "PostgreSQL"
)

func (DBTypeEnum) String

func (d DBTypeEnum) String() string

type DBTypeSupport

type DBTypeSupport struct {
	DBType    DBTypeEnum `json:"dbType"`
	DBVersion string     `json:"dbVersion"`
}

type DCLOpEnum

type DCLOpEnum string

DCLOpEnum defines the MigrationTask CR .spec.migrationObj +enum +kubebuilder:validation:Enum={all,none}

type DDLOpEnum

type DDLOpEnum string

DDLOpEnum defines the MigrationTask CR .spec.migrationObj +enum +kubebuilder:validation:Enum={all,none}

const (
	AllDDL  DDLOpEnum = "all"
	NoneDDL DDLOpEnum = "none"
)
const (
	AllDCL  DDLOpEnum = "all"
	NoneDCL DDLOpEnum = "none"
)

type DMLOpEnum

type DMLOpEnum string

DMLOpEnum defines the MigrationTask CR .spec.migrationObj +enum +kubebuilder:validation:Enum={all,none,insert,update,delete}

const (
	AllDML  DMLOpEnum = "all"
	NoneDML DMLOpEnum = "none"
	Insert  DMLOpEnum = "insert"
	Update  DMLOpEnum = "update"
	Delete  DMLOpEnum = "delete"
)

type DxlOpConfig

type DxlOpConfig struct {
	// +optional
	DmlOp []DMLOpEnum `json:"dmlOp"`
	// +optional
	DdlOp []DDLOpEnum `json:"ddlOp"`
	// +optional
	DclOp []DCLOpEnum `json:"dclOp"`
}

func (*DxlOpConfig) IsEmpty

func (op *DxlOpConfig) IsEmpty() bool

type Endpoint

type Endpoint struct {
	// +optional
	EndpointType EndpointTypeEnum `json:"endpointType,omitempty"`
	Address      string           `json:"address"`
	// +optional
	DatabaseName string `json:"databaseName,omitempty"`
	// +optional
	UserName string `json:"userName"`
	// +optional
	Password string `json:"password"`
	// +optional
	Secret UserPswSecret `json:"secret"`
}

type EndpointTypeEnum

type EndpointTypeEnum string

EndpointTypeEnum defines the MigrationTask CR .spec.source.endpointType and .spec.sink.endpointType +enum +kubebuilder:validation:Enum={address}

const (
	AddressDirectConnect EndpointTypeEnum = "address" // default value
)

type FieldObjectExpress

type FieldObjectExpress struct {
	FieldName string `json:"fieldName"`
	// +optional
	FieldMappingName string `json:"fieldMappingName"`
}

type InitializationConfig

type InitializationConfig struct {
	// +optional
	Steps []StepEnum `json:"steps,omitempty"`
	// +optional
	Config map[StepEnum]BaseConfig `json:"config,omitempty"`
}

type InitializationModel

type InitializationModel struct {
	// +optional
	IsPositionPreparation bool        `json:"isPositionPreparation,omitempty"`
	Steps                 []StepModel `json:"steps,omitempty"`
}

type IntOrStringMap

type IntOrStringMap map[string]interface{}

func (*IntOrStringMap) DeepCopy

func (in *IntOrStringMap) DeepCopy() *IntOrStringMap

func (*IntOrStringMap) DeepCopyInto

func (in *IntOrStringMap) DeepCopyInto(out *IntOrStringMap)

type Metrics

type Metrics struct {
	IsDisable     bool  `json:"isDisable,omitempty"`
	PeriodSeconds int32 `json:"periodSeconds,omitempty"`
}

type MigrationObjectExpress

type MigrationObjectExpress struct {
	WhiteList []DBObjectExpress `json:"whiteList"`
	// +optional
	BlackList []DBObjectExpress `json:"blackList"`
}

func (*MigrationObjectExpress) String

func (m *MigrationObjectExpress) String(isWhite bool) string

type MigrationObjects

type MigrationObjects struct {
	Task     *MigrationTask
	Template *MigrationTemplate

	Jobs         *batchv1.JobList
	Pods         *v1.PodList
	StatefulSets *appv1.StatefulSetList
}

type MigrationTask

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

	Spec   MigrationTaskSpec   `json:"spec,omitempty"`
	Status MigrationTaskStatus `json:"status,omitempty"`
}

MigrationTask is the Schema for the migrationTasks API

type MigrationTaskList

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

MigrationTaskList contains a list of MigrationTask

type MigrationTaskSpec

type MigrationTaskSpec struct {
	TaskType       TaskTypeEnum `json:"taskType,omitempty"`
	Template       string       `json:"template"`
	SourceEndpoint Endpoint     `json:"sourceEndpoint,omitempty"`
	SinkEndpoint   Endpoint     `json:"sinkEndpoint,omitempty"`
	// +optional
	Cdc CdcConfig `json:"cdc,omitempty"`
	// +optional
	Initialization InitializationConfig   `json:"initialization,omitempty"`
	MigrationObj   MigrationObjectExpress `json:"migrationObj,omitempty"`
	// +optional
	IsForceDelete bool `json:"isForceDelete,omitempty"`
	// +optional
	GlobalTolerations []v1.Toleration `json:"globalTolerations,omitempty"`
	// +optional
	GlobalResources v1.ResourceRequirements `json:"globalResources,omitempty"`
}

MigrationTaskSpec defines the desired state of MigrationTask

type MigrationTaskStatus

type MigrationTaskStatus struct {
	// +optional
	TaskStatus TaskStatus `json:"taskStatus"`
	// +optional
	StartTime *metav1.Time `json:"startTime"`
	// +optional
	FinishTime *metav1.Time `json:"finishTime"`
	// +optional
	Cdc RunTimeStatus `json:"cdc"`
	// +optional
	Initialization RunTimeStatus `json:"initialization"`
}

MigrationTaskStatus defines the observed state of MigrationTask

type MigrationTemplate

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

	Spec   MigrationTemplateSpec   `json:"spec,omitempty"`
	Status MigrationTemplateStatus `json:"status,omitempty"`
}

MigrationTemplate is the Schema for the migrationtemplates API

type MigrationTemplateList

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

MigrationTemplateList contains a list of MigrationTemplate

type MigrationTemplateSpec

type MigrationTemplateSpec struct {
	TaskType       []TaskTypeEnum      `json:"taskType,omitempty"`
	Source         DBTypeSupport       `json:"source"`
	Sink           DBTypeSupport       `json:"target"`
	Initialization InitializationModel `json:"initialization,omitempty"`
	Cdc            CdcModel            `json:"cdc,omitempty"`
	// +optional
	Description string `json:"description,omitempty"`
	// +optional
	Decorator string `json:"decorator,omitempty"`
}

MigrationTemplateSpec defines the desired state of MigrationTemplate

type MigrationTemplateStatus

type MigrationTemplateStatus struct {
	Phase Phase `json:"phase,omitempty"`
}

MigrationTemplateStatus defines the observed state of MigrationTemplate

type Phase

type Phase string

Phase defines the MigrationTemplate CR .status.phase +enum +kubebuilder:validation:Enum={Available,Unavailable}

const (
	AvailablePhase   Phase = "Available"
	UnavailablePhase Phase = "Unavailable"
)

type RunTimeStatus

type RunTimeStatus struct {
	// +optional
	StartTime *metav1.Time `json:"startTime"`
	// +optional
	FinishTime *metav1.Time `json:"finishTime"`
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	RunTimeParam IntOrStringMap `json:"runTimeParam,omitempty"`
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	Metrics IntOrStringMap `json:"metrics,omitempty"`
	// +optional
	FailedReason string `json:"failedReason,omitempty"`
}

type StepEnum

type StepEnum string

StepEnum defines the MigrationTask CR .spec.steps +enum +kubebuilder:validation:Enum={preCheck,initStruct,initData,initStructLater}

const (
	StepPreCheck            StepEnum = "preCheck"
	StepStructPreFullLoad   StepEnum = "initStruct"
	StepFullLoad            StepEnum = "initData"
	StepStructAfterFullLoad StepEnum = "initStructLater"
	StepInitialization      StepEnum = "initialization"
	StepPreDelete           StepEnum = "preDelete"
	StepCdc                 StepEnum = "cdc"
)

func (StepEnum) CliString

func (s StepEnum) CliString() string

func (StepEnum) LowerCaseString

func (s StepEnum) LowerCaseString() string

func (StepEnum) String

func (s StepEnum) String() string

type StepModel

type StepModel struct {
	Step      StepEnum               `json:"step"`
	Container BasicContainerTemplate `json:"container"`
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	Param IntOrStringMap `json:"param"`
}

type TableObjectExpress

type TableObjectExpress struct {
	TableName string `json:"tableName"`
	// +optional
	TableMappingName string `json:"tableMappingName"`
	// +optional
	IsAll bool `json:"isAll"`
	// +optional
	FieldList   []FieldObjectExpress `json:"fieldList"`
	DxlOpConfig `json:""`
}

type TaskStatus

type TaskStatus string

TaskStatus defines the MigrationTask CR .status.taskStatus +enum +kubebuilder:validation:Enum={Prepare,InitPrepared,Init,InitFinished,Running,Cached,Pause,Done}

const (
	PrepareStatus TaskStatus = "Prepare"
	InitPrepared  TaskStatus = "InitPrepared"
	InitStatus    TaskStatus = "Init"
	InitFinished  TaskStatus = "InitFinished"
	RunningStatus TaskStatus = "Running"
	CachedStatus  TaskStatus = "Cached"
	PauseStatus   TaskStatus = "Pause"
	DoneStatus    TaskStatus = "Done"
)

type TaskTypeEnum

type TaskTypeEnum string

TaskTypeEnum defines the MigrationTask CR .spec.taskType +enum +kubebuilder:validation:Enum={initialization,cdc,initialization-and-cdc,initialization-and-twoway-cdc}

const (
	Initialization       TaskTypeEnum = "initialization"
	CDC                  TaskTypeEnum = "cdc"
	InitializationAndCdc TaskTypeEnum = "initialization-and-cdc" // default value
)

type UserPswSecret

type UserPswSecret struct {
	Name string `json:"name"`
	// +optional
	Namespace string `json:"namespace,omitempty"`
	// +optional
	UserKeyword string `json:"userKeyword,omitempty"`
	// +optional
	PasswordKeyword string `json:"passwordKeyword,omitempty"`
}

Jump to

Keyboard shortcuts

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